mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Update puppet module tests to reflect changes in mock_open
This commit is contained in:
parent
33a97c4ecc
commit
7f516ef73a
1 changed files with 3 additions and 2 deletions
|
@ -140,8 +140,9 @@ class PuppetTestCase(TestCase, LoaderModuleMockMixin):
|
|||
mock_open(read_data="resources: 1")):
|
||||
self.assertDictEqual(puppet.summary(), {'resources': 1})
|
||||
|
||||
with patch('salt.utils.files.fopen', mock_open()) as m_open:
|
||||
m_open.side_effect = IOError(13, 'Permission denied:', '/file')
|
||||
permission_error = IOError(os.errno.EACCES, 'Permission denied:', '/file')
|
||||
with patch('salt.utils.files.fopen',
|
||||
mock_open(read_data=permission_error)) as m_open:
|
||||
self.assertRaises(CommandExecutionError, puppet.summary)
|
||||
|
||||
def test_plugin_sync(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue