Merge pull request #43399 from twangboy/win_fix_test_pam

Fix `unit.modules.test_pam` for Windows
This commit is contained in:
Nicole Thomas 2017-09-08 09:37:49 -04:00 committed by GitHub
commit 6a4cc5c1b0

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'}])