Fixes minor unit tests inconsistentcies
Minor inconsistentcies were introduced. Fixes them. Change-Id: I64388941a728d0b5661a91f10664465fc0f78a87
This commit is contained in:
@@ -36,9 +36,8 @@ class LiveMigrationOpsTestCase(test_base.HyperVBaseTestCase):
|
||||
|
||||
@mock.patch('hyperv.nova.serialconsoleops.SerialConsoleOps.'
|
||||
'stop_console_handler')
|
||||
@mock.patch('hyperv.nova.pathutils.PathUtils.copy_vm_console_logs')
|
||||
@mock.patch('hyperv.nova.vmops.VMOps.copy_vm_dvd_disks')
|
||||
def _test_live_migration(self, mock_get_vm_dvd_paths, mock_copy_logs,
|
||||
def _test_live_migration(self, mock_get_vm_dvd_paths,
|
||||
mock_stop_console_handler, side_effect):
|
||||
mock_instance = fake_instance.fake_instance_obj(self.context)
|
||||
mock_post = mock.MagicMock()
|
||||
@@ -62,6 +61,7 @@ class LiveMigrationOpsTestCase(test_base.HyperVBaseTestCase):
|
||||
|
||||
mock_stop_console_handler.assert_called_once_with(
|
||||
mock_instance.name)
|
||||
mock_copy_logs = self._livemigrops._pathutils.copy_vm_console_logs
|
||||
mock_copy_logs.assert_called_once_with(mock_instance.name,
|
||||
fake_dest)
|
||||
mock_live_migr = self._livemigrops._livemigrutils.live_migrate_vm
|
||||
|
@@ -77,7 +77,7 @@ class MigrationOpsTestCase(test_base.HyperVBaseTestCase):
|
||||
expected_get_dir)
|
||||
self._migrationops._pathutils.copy.assert_called_once_with(
|
||||
self._FAKE_DISK, fake_dest_path)
|
||||
self._migrationops._pathutils.move_folder_contents.assert_has_calls(
|
||||
self._migrationops._pathutils.move_folder_files.assert_has_calls(
|
||||
expected_move_calls)
|
||||
|
||||
def test_migrate_disk_files(self):
|
||||
|
@@ -1065,7 +1065,7 @@ class VMOpsTestCase(test_base.HyperVBaseTestCase):
|
||||
mock.sentinel.FAKE_DEST_PATH)
|
||||
|
||||
self._vmops.copy_vm_dvd_disks(mock.sentinel.FAKE_VM_NAME,
|
||||
mock.sentinel.FAKE_DEST)
|
||||
mock.sentinel.FAKE_DEST_HOST)
|
||||
|
||||
mock_get_dvd_disk_paths.assert_called_with(mock.sentinel.FAKE_VM_NAME)
|
||||
self._vmops._pathutils.get_instance_dir.assert_called_once_with(
|
||||
|
Reference in New Issue
Block a user