This commit is contained in:
Mike Place 2017-04-06 10:48:27 -06:00
parent 86e324aa52
commit 60750a1619
No known key found for this signature in database
GPG Key ID: 9136F4F13705CFD3

View File

@ -81,9 +81,9 @@ class SaltmodTestCase(TestCase, LoaderModuleMockMixin):
with patch.dict(saltmod.__opts__, {'test': True}):
self.assertDictEqual(saltmod.state(name, tgt, highstate=True), test_ret)
ret.update({'comment': 'States ran successfully.', 'result': True})
ret.update({'comment': 'States ran successfully. No changes made to silver.', 'result': True, '__jid__': '20170406104341210934'})
with patch.dict(saltmod.__opts__, {'test': False}):
mock = MagicMock(return_value={})
mock = MagicMock(return_value={'silver': {'jid': '20170406104341210934', 'retcode': 0, 'ret': {'test_|-notify_me_|-this is a name_|-show_notification': {'comment': 'Notify me', 'name': 'this is a name', 'start_time': '10:43:41.487565', 'result': True, 'duration': 0.35, '__run_num__': 0, '__sls__': 'demo', 'changes': {}, '__id__': 'notify_me'}}, 'out': 'highstate'}})
with patch.dict(saltmod.__salt__, {'saltutil.cmd': mock}):
self.assertDictEqual(saltmod.state(name, tgt, highstate=True),
ret)