summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Smith <dansmith@redhat.com>2015-02-03 16:29:55 -0800
committerDan Smith <dansmith@redhat.com>2015-02-03 16:29:55 -0800
commitc40ae6183494d5df019de61412412b388a87d9e4 (patch)
treec9e7700d17c7bb71bdc3abdcffa1dfd6a6a5f41a
parent20e7c0b63fff0e7d6f939709bdca4f1040053130 (diff)
downloadnova-c40ae6183494d5df019de61412412b388a87d9e4.tar.gz
Fix corrupting the object repository with test instance objects
In order to test older instance versions in the remote instance tests, we were creating an OldInstance object masquerading as a proper Instance so we could override the version. That had the potential to confuse other instance object tests because from that point on, it was the first Instance object in the repository, breaking the ordering requirement. Since we don't need it to be called Instance to test what we want to test, this patch just removes the masquerading bit. Change-Id: Iabb77ea3084c3701bf67f051ace494a1efb12917 Closes-Bug: #1417678
-rw-r--r--nova/tests/unit/objects/test_instance.py8
1 files changed, 0 insertions, 8 deletions
diff --git a/nova/tests/unit/objects/test_instance.py b/nova/tests/unit/objects/test_instance.py
index d36d1d8e56..678f627d29 100644
--- a/nova/tests/unit/objects/test_instance.py
+++ b/nova/tests/unit/objects/test_instance.py
@@ -1133,10 +1133,6 @@ class TestRemoteInstanceObject(test_objects._RemoteTest,
class OldInstance(objects.Instance):
VERSION = '1.17'
- @classmethod
- def obj_name(cls):
- return 'Instance'
-
inst = OldInstance.get_by_uuid(self.context, inst.uuid)
self.assertFalse(inst.obj_attr_is_set('system_metadata'))
self.assertEqual('bar', inst.system_metadata['foo'])
@@ -1155,10 +1151,6 @@ class TestRemoteInstanceObject(test_objects._RemoteTest,
class OldInstance(objects.Instance):
VERSION = '1.17'
- @classmethod
- def obj_name(cls):
- return 'Instance'
-
inst = OldInstance.get_by_uuid(self.context, inst.uuid,
expected_attrs=['system_metadata'])
self.assertTrue(inst.obj_attr_is_set('system_metadata'))