Merge pull request #47985 from twangboy/fix_test_reg

Fix `unit.states.test_reg` test failure
This commit is contained in:
Nicole Thomas 2018-06-06 10:56:02 -04:00 committed by GitHub
commit 1b4c72345b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,8 +48,10 @@ class RegTestCase(TestCase, LoaderModuleMockMixin):
{'vdata': 'a', 'success': True},
{'vdata': 'a', 'success': True}])
mock_t = MagicMock(return_value=True)
mock_cast = MagicMock(return_value=vdata)
with patch.dict(reg.__utils__, {'reg.read_value': mock_read,
'reg.set_value': mock_t}):
'reg.set_value': mock_t,
'reg.cast_vdata': mock_cast}):
self.assertDictEqual(reg.present(name,
vname=vname,
vdata=vdata), ret)