def test_update(self):
        name = 'CURL'

        ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}

        changes = {'new': 'composer install/update will be run in CURL',
                   'old': 'composer install has not yet been run in CURL'}

        mock = MagicMock(return_value=True)
        with patch.dict(composer.__salt__,
                        {'composer.did_composer_install': mock}):
            with patch.dict(composer.__opts__, {'test': True}):
                comt = ('The state of "CURL" will be changed.')
                ret.update({'comment': comt, 'result': None,
                            'changes': changes})
                self.assertDictEqual(composer.update(name), ret)

            with patch.dict(composer.__opts__, {'test': False}):
                mock = MagicMock(side_effect=[SaltException, {}])
                with patch.dict(composer.__salt__, {'composer.update': mock}):
                    comt = ("Error executing composer in "
                            "''CURL'': SaltException('',)")
                    ret.update({'comment': comt, 'result': False,
                                'changes': {}})
                    self.assertDictEqual(composer.update(name), ret)

                    comt = ('Composer update completed successfully,'
                            ' output silenced by quiet flag')
                    ret.update({'comment': comt, 'result': True})
                    self.assertDictEqual(composer.update(name, quiet=True),
                                         ret)
Test to composer update the directory to ensure we have
dataset/ETHPy150Open saltstack/salt/tests/unit/states/composer_test.py/ComposerTestCase.test_update