Fix unit.modules.test_pam for Windows

Mocks os.path.exists
This commit is contained in:
twangboy 2017-09-07 15:18:14 -06:00
parent f959113694
commit 6257aa964a

View file

@ -34,7 +34,8 @@ class PamTestCase(TestCase):
'''
Test if the parsing function works
'''
with patch('salt.utils.fopen', mock_open(read_data=MOCK_FILE)):
with patch('os.path.exists', return_value=True), \
patch('salt.utils.fopen', mock_open(read_data=MOCK_FILE)):
self.assertListEqual(pam.read_file('/etc/pam.d/login'),
[{'arguments': [], 'control_flag': 'ok',
'interface': 'ok', 'module': 'ignore'}])