mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fixes broken rm_fstab test due to missing __grain__.kernel
This commit is contained in:
parent
d633e774ea
commit
b8c6948cd5
1 changed files with 11 additions and 9 deletions
|
@ -132,17 +132,19 @@ class MountTestCase(TestCase):
|
|||
Remove the mount point from the fstab
|
||||
'''
|
||||
mock_fstab = MagicMock(return_value={})
|
||||
with patch.object(mount, 'fstab', mock_fstab):
|
||||
with patch('salt.utils.fopen', mock_open()):
|
||||
self.assertTrue(mount.rm_fstab('name', 'device'))
|
||||
with patch.dict(mount.__grains__, {'kernel': ''}):
|
||||
with patch.object(mount, 'fstab', mock_fstab):
|
||||
with patch('salt.utils.fopen', mock_open()):
|
||||
self.assertTrue(mount.rm_fstab('name', 'device'))
|
||||
|
||||
mock_fstab = MagicMock(return_value={'name': 'name'})
|
||||
with patch.object(mount, 'fstab', mock_fstab):
|
||||
with patch('salt.utils.fopen', mock_open()) as m_open:
|
||||
helper_open = m_open()
|
||||
helper_open.write.assertRaises(CommandExecutionError,
|
||||
mount.rm_fstab,
|
||||
config=None)
|
||||
with patch.dict(mount.__grains__, {'kernel': ''}):
|
||||
with patch.object(mount, 'fstab', mock_fstab):
|
||||
with patch('salt.utils.fopen', mock_open()) as m_open:
|
||||
helper_open = m_open()
|
||||
helper_open.write.assertRaises(CommandExecutionError,
|
||||
mount.rm_fstab,
|
||||
config=None)
|
||||
|
||||
def test_set_fstab(self):
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue