Skip to content

Commit

Permalink
Merge "hyper-v: mock time.sleep in test_rmtree"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Aug 29, 2015
2 parents 64a31ba + ec5879d commit 9c700a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nova/tests/unit/virt/hyperv/test_pathutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ def test_soft_unmount_smb_share(self):
def test_force_unmount_smb_share(self):
self._test_unmount_smb_share(force=True)

@mock.patch('time.sleep')
@mock.patch('shutil.rmtree')
def test_rmtree(self, mock_rmtree):
def test_rmtree(self, mock_rmtree, mock_sleep):
class WindowsError(Exception):
def __init__(self, winerror=None):
self.winerror = winerror
Expand All @@ -171,6 +172,7 @@ def __init__(self, winerror=None):

mock_rmtree.assert_has_calls([mock.call(mock.sentinel.FAKE_PATH),
mock.call(mock.sentinel.FAKE_PATH)])
mock_sleep.assert_called_once_with(1)

@mock.patch('os.path.join')
def test_get_instances_sub_dir(self, fake_path_join):
Expand Down

0 comments on commit 9c700a9

Please sign in to comment.