summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Carey <jecarey@us.ibm.com>2015-04-01 18:28:29 +0000
committerJames Carey <jecarey@us.ibm.com>2015-04-01 18:28:29 +0000
commitce3bcdb6116dbc1595e630d92ef16c614ab92314 (patch)
tree6155a12ac1f48940be05533894960b60c71bc39d
parent503a7bb4dd28f9659de8c7b389c91dd65dbad57e (diff)
downloadglance-ce3bcdb6116dbc1595e630d92ef16c614ab92314.tar.gz
Fix intermittent test case failure due to dict order
The test case expected output relies on the order of strings generated from the arbitrary ordering of dictionaries. Change to be resilient to ordering by using assertIn on each item instead of assertEqual on the generated list. Change-Id: Ib4f0586a24846660aedc20517f58fa7ff0dd6cc6 Closes-Bug: 1436424
-rw-r--r--glance/tests/unit/test_db.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/glance/tests/unit/test_db.py b/glance/tests/unit/test_db.py
index 3eda43752..577d541a4 100644
--- a/glance/tests/unit/test_db.py
+++ b/glance/tests/unit/test_db.py
@@ -262,7 +262,8 @@ class TestImageRepo(test_utils.BaseTestCase):
images = self.image_repo.list(filters=filters)
image_ids = list([i.image_id for i in images])
self.assertEqual(2, len(image_ids))
- self.assertEqual([UUID3, UUID2], image_ids)
+ self.assertIn(UUID2, image_ids)
+ self.assertIn(UUID3, image_ids)
def test_list_with_wrong_checksum(self):
WRONG_CHKSUM = 'd2fd42f979e1ed1aafadc7eb9354bff839c858cd'