Merge pull request #51311 from twangboy/fix_test_file.test_managed

Fix failing test `unit.states.test_file.TestFileState.test_managed` on Windows
This commit is contained in:
Thomas S Hatch 2019-01-24 14:09:35 -07:00 committed by GitHub
commit e246fdb6d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -775,10 +775,15 @@ class TestFileState(TestCase, LoaderModuleMockMixin):
with patch.object(os.path, 'exists', mock_t):
with patch.dict(filestate.__opts__, {'test': True}):
ret.update({'comment': comt})
self.assertDictEqual(filestate.managed
(name, user=user,
group=group,
mode=400), ret)
if salt.utils.is_windows():
self.assertDictEqual(filestate.managed
(name, user=user,
group=group), ret)
else:
self.assertDictEqual(filestate.managed
(name, user=user,
group=group,
mode=400), ret)
# 'directory' function tests: 1