def test_bootstrap(self):
        name = 'coffee-script'

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

        mock_err = MagicMock(side_effect=[CommandExecutionError, False, True])
        with patch.dict(npm.__salt__, {'npm.install': mock_err}):
            comt = ("Error Bootstrapping 'coffee-script': ")
            ret.update({'comment': comt})
            self.assertDictEqual(npm.bootstrap(name), ret)

            comt = ('Directory is already bootstrapped')
            ret.update({'comment': comt, 'result': True})
            self.assertDictEqual(npm.bootstrap(name), ret)

            comt = ('Directory was successfully bootstrapped')
            ret.update({'comment': comt, 'result': True,
                        'changes': {name: 'Bootstrapped'}})
            self.assertDictEqual(npm.bootstrap(name), ret)

    # 'bootstrap' function tests: 1
Test to bootstraps a node.js application.
dataset/ETHPy150Open saltstack/salt/tests/unit/states/npm_test.py/NpmTestCase.test_bootstrap