Beispiel #1
0
    def test_solo(self):
        """
        Test to run chef-solo
        """
        name = "my-chef-run"

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

        mock = MagicMock(return_value={"retcode": 1, "stdout": "", "stderr": "error"})
        with patch.dict(chef.__salt__, {"chef.solo": mock}):
            with patch.dict(chef.__opts__, {"test": True}):
                comt = "\nerror"
                ret.update({"comment": comt})
                self.assertDictEqual(chef.solo(name), ret)
Beispiel #2
0
    def test_solo(self):
        '''
        Test to run chef-solo
        '''
        name = 'my-chef-run'

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

        mock = MagicMock(return_value={
            'retcode': 1,
            'stdout': '',
            'stderr': 'error'
        })
        with patch.dict(chef.__salt__, {'chef.solo': mock}):
            with patch.dict(chef.__opts__, {'test': True}):
                comt = ('\nerror')
                ret.update({'comment': comt})
                self.assertDictEqual(chef.solo(name), ret)
Beispiel #3
0
    def test_solo(self):
        '''
        Test to run chef-solo
        '''
        name = 'my-chef-run'

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

        mock = MagicMock(return_value={'retcode': 1, 'stdout': '',
                                       'stderr': 'error'})
        with patch.dict(chef.__salt__, {'chef.solo': mock}):
            with patch.dict(chef.__opts__, {'test': True}):
                comt = ('\nerror')
                ret.update({'comment': comt})
                self.assertDictEqual(chef.solo(name), ret)