From c40ae6183494d5df019de61412412b388a87d9e4 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 3 Feb 2015 16:29:55 -0800 Subject: 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 --- nova/tests/unit/objects/test_instance.py | 8 -------- 1 file changed, 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')) -- cgit v1.2.1