def test_installed(self):
        name = 'CURL'

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

        mock = MagicMock(return_value=True)
        with patch.dict(composer.__salt__,
                        {'composer.did_composer_install': mock}):
            comt = ('Composer already installed this directory')
            ret.update({'comment': comt})
            self.assertDictEqual(composer.installed(name, always_check=False),
                                 ret)

            with patch.dict(composer.__opts__, {'test': True}):
                comt = ('The state of "CURL" will be changed.')
                changes = {'new': 'composer install will be run in CURL',
                           'old': 'composer install has been run in CURL'}
                ret.update({'comment': comt, 'result': None,
                            'changes': changes})
                self.assertDictEqual(composer.installed(name), ret)

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

                    comt = ('Composer install completed successfully,'
                            ' output silenced by quiet flag')
                    ret.update({'comment': comt, 'result': True})
                    self.assertDictEqual(composer.installed(name, quiet=True),
                                         ret)

    # 'update' function tests: 1
Cheap and simple computation in simple case
dataset/ETHPy150Open saltstack/salt/tests/unit/states/composer_test.py/ComposerTestCase.test_installed--crossover with--dataset/ETHPy150Open blaze/blaze/blaze/compute/bcolz.py/compute_down