Moving create success together

This commit is contained in:
Nitin Madhok 2014-12-20 13:04:53 -05:00
parent 4a3ba21201
commit 2ef5edbbca

View File

@ -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)