Merge "Fix test_migrate_disk_and_power_off_exception"
This commit is contained in:
1 changed files with 6 additions and 6 deletions
@@ -2122,7 +2122,7 @@ class LibvirtConnectionTestCase(test.TestCase):
self.counter = 0
def fake_get_instance_disk_info(instance):
return []
return '[]'
def fake_destroy(instance, network_info, cleanup=True):
pass
@@ -2133,8 +2133,7 @@ class LibvirtConnectionTestCase(test.TestCase):
def fake_execute(*args, **kwargs):
self.counter += 1
if self.counter == 1:
raise Exception()
pass
assert False, "intentional failure"
def fake_os_path_exists(path):
return True
@@ -2148,9 +2147,10 @@ class LibvirtConnectionTestCase(test.TestCase):
self.stubs.Set(os.path, 'exists', fake_os_path_exists)
ins_ref = self._create_instance()
self.assertRaises(Exception,
self.libvirtconnection.migrate_disk_and_power_off,
None, ins_ref, [], '10.0.0.2', None, None)
self.assertRaises(AssertionError,
self.libvirtconnection.migrate_disk_and_power_off,
None, ins_ref, '10.0.0.2', None, None)
def test_migrate_disk_and_power_off(self):
"""Test for nova.virt.libvirt.connection.LivirtConnection
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.