Better return data for mocked saltutil.cmd for saltmod.function

This commit is contained in:
Colton Myers 2015-04-16 17:46:32 -06:00
parent a8a5ee5fa6
commit 728e74c921

View File

@ -95,7 +95,7 @@ class SaltmodTestCase(TestCase):
ret.update({'comment': 'Function ran successfully.', 'result': True})
with patch.dict(saltmod.__opts__, {'test': False}):
mock = MagicMock(return_value={})
mock = MagicMock(return_value={'minion': {'retcode': 0, 'ret': True}})
with patch.dict(saltmod.__salt__, {'saltutil.cmd': mock}):
self.assertDictEqual(saltmod.function(name, tgt), ret)