Fix unit.states.test_augeas for Windows

Mock `os.path.isfile` so the test will continue
This commit is contained in:
twangboy 2017-09-29 12:52:32 -06:00
parent c6fd2cd452
commit fd1d6c31de
No known key found for this signature in database
GPG key ID: 93FF3BDEB278C9EB

View file

@ -140,7 +140,8 @@ class AugeasTestCase(TestCase, LoaderModuleMockMixin):
'augeas.method_map': self.mock_method_map}
with patch.dict(augeas.__salt__, mock_dict_):
mock_filename = MagicMock(return_value='/etc/services')
with patch.object(augeas, '_workout_filename', mock_filename):
with patch.object(augeas, '_workout_filename', mock_filename), \
patch('os.path.isfile', MagicMock(return_value=True)):
with patch('salt.utils.fopen', MagicMock(mock_open)):
mock_diff = MagicMock(return_value=['+ zabbix-agent'])
with patch('difflib.unified_diff', mock_diff):