mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Moving create success together
This commit is contained in:
parent
4a3ba21201
commit
2ef5edbbca
@ -74,6 +74,16 @@ class ZfsTestCase(TestCase):
|
||||
with patch.dict(zfs.__salt__, {'cmd.run': mock_cmd}):
|
||||
self.assertEqual(zfs.create('myzpool/mydataset'), ret)
|
||||
|
||||
@patch('salt.modules.zfs._check_zfs', MagicMock(return_value='/sbin/zfs'))
|
||||
def test_create_success_with_create_parent(self):
|
||||
'''
|
||||
Tests successful return of create function when ``create_parent=True``
|
||||
'''
|
||||
ret = {'myzpool/mydataset/mysubdataset': 'created'}
|
||||
mock_cmd = MagicMock(return_value="")
|
||||
with patch.dict(zfs.__salt__, {'cmd.run': mock_cmd}):
|
||||
self.assertEqual(zfs.create('myzpool/mydataset/mysubdataset'), ret)
|
||||
|
||||
@patch('salt.modules.zfs._check_zfs', MagicMock(return_value='/sbin/zfs'))
|
||||
def test_create_success_with_properties(self):
|
||||
'''
|
||||
@ -136,16 +146,6 @@ class ZfsTestCase(TestCase):
|
||||
with patch.dict(zfs.__salt__, {'cmd.run': mock_cmd}):
|
||||
self.assertEqual(zfs.create('myzpool/mydataset/mysubdataset'), ret)
|
||||
|
||||
@patch('salt.modules.zfs._check_zfs', MagicMock(return_value='/sbin/zfs'))
|
||||
def test_create_success_with_create_parent(self):
|
||||
'''
|
||||
Tests successful return of create function when ``create_parent=True``
|
||||
'''
|
||||
ret = {'myzpool/mydataset/mysubdataset': 'created'}
|
||||
mock_cmd = MagicMock(return_value="")
|
||||
with patch.dict(zfs.__salt__, {'cmd.run': mock_cmd}):
|
||||
self.assertEqual(zfs.create('myzpool/mydataset/mysubdataset'), ret)
|
||||
|
||||
if __name__ == '__main__':
|
||||
from integration import run_tests
|
||||
run_tests(ZfsTestCase, needs_daemon=False)
|
||||
|
Loading…
Reference in New Issue
Block a user