summaryrefslogtreecommitdiff
path: root/nova/tests/unit/test_fixtures.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/tests/unit/test_fixtures.py')
-rw-r--r--nova/tests/unit/test_fixtures.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/nova/tests/unit/test_fixtures.py b/nova/tests/unit/test_fixtures.py
index 16b87cea47..f0764fada5 100644
--- a/nova/tests/unit/test_fixtures.py
+++ b/nova/tests/unit/test_fixtures.py
@@ -331,3 +331,17 @@ class TestBannedDBSchemaOperations(testtools.TestCase):
table.drop)
self.assertRaises(exception.DBNotAllowed,
table.alter)
+
+
+class TestStableObjectJsonFixture(testtools.TestCase):
+ def test_changes_sort(self):
+ class TestObject(obj_base.NovaObject):
+ def obj_what_changed(self):
+ return ['z', 'a']
+
+ obj = TestObject()
+ self.assertEqual(['z', 'a'],
+ obj.obj_to_primitive()['nova_object.changes'])
+ with fixtures.StableObjectJsonFixture():
+ self.assertEqual(['a', 'z'],
+ obj.obj_to_primitive()['nova_object.changes'])