And unit tests

This commit is contained in:
matt.dietz@rackspace.com
2011-03-07 22:50:35 +00:00
parent fa23398883
commit 005677ce9e
2 changed files with 9 additions and 0 deletions

View File

@@ -383,6 +383,11 @@ class XenAPIMigrateInstance(test.TestCase):
conn = xenapi_conn.get_connection(False)
conn.attach_disk(instance, {'base_copy': 'hurr', 'cow': 'durr'})
def test_finish_resize(self):
instance = db.instance_create(self.values)
stubs.stubout_session(self.stubs, stubs.FakeSessionForMigrationTests)
conn = xenapi_conn.get_connection(False)
conn.finish_resize(instance, dict(base_copy='hurr', cow='durr'))
class XenAPIDetermineDiskImageTestCase(test.TestCase):
"""

View File

@@ -251,6 +251,9 @@ def stub_out_migration_methods(stubs):
def fake_destroy(*args, **kwargs):
pass
def fake_spawn_with_disk(*args, **kwargs):
pass
stubs.Set(vmops.VMOps, '_destroy', fake_destroy)
stubs.Set(vm_utils.VMHelper, 'scan_default_sr', fake_sr)
stubs.Set(vm_utils.VMHelper, 'scan_sr', fake_sr)
@@ -259,3 +262,4 @@ def stub_out_migration_methods(stubs):
stubs.Set(xenapi_conn.XenAPISession, 'wait_for_task', lambda x, y, z: None)
stubs.Set(vm_utils.VMHelper, 'get_sr_path', fake_get_sr_path)
stubs.Set(vmops.VMOps, '_shutdown', fake_shutdown)
stubs.Set(vmops.VMOps, 'spawn_with_disk', fake_spawn_with_disk)