def test_solo(self): ''' Test if it execute a chef solo run and return a dict ''' with patch.dict(chef.__opts__, {'cachedir': r'c:\salt\var\cache\salt\minion'}): self.assertDictEqual(chef.solo('/dev/sda1'), {})
def test_solo(self): """ Test if it execute a chef solo run and return a dict """ with patch.dict(chef.__opts__, {"cachedir": r"c:\salt\var\cache\salt\minion"}): self.assertDictEqual(chef.solo("/dev/sda1"), {})
def test_solo(): """ 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}) assert chef.solo(name) == ret
def test_solo(self): ''' Test if it execute a chef solo run and return a dict ''' self.assertDictEqual(chef.solo('/dev/sda1'), {})
def test_solo(self): """ Test if it execute a chef solo run and return a dict """ with patch("salt.utils.path.which", MagicMock(return_value=True)): self.assertDictEqual(chef.solo("/dev/sda1"), {})