mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Better return data for mocked saltutil.cmd for saltmod.function
This commit is contained in:
parent
a8a5ee5fa6
commit
728e74c921
@ -95,7 +95,7 @@ class SaltmodTestCase(TestCase):
|
|||||||
|
|
||||||
ret.update({'comment': 'Function ran successfully.', 'result': True})
|
ret.update({'comment': 'Function ran successfully.', 'result': True})
|
||||||
with patch.dict(saltmod.__opts__, {'test': False}):
|
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}):
|
with patch.dict(saltmod.__salt__, {'saltutil.cmd': mock}):
|
||||||
self.assertDictEqual(saltmod.function(name, tgt), ret)
|
self.assertDictEqual(saltmod.function(name, tgt), ret)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user