diff options
| author | Chris Behrens <cbehrens@codestud.com> | 2011-09-19 15:08:25 -0700 |
|---|---|---|
| committer | Chris Behrens <cbehrens@codestud.com> | 2011-09-19 15:08:25 -0700 |
| commit | b0ca3a42995cc25852420083e431c3be5071d221 (patch) | |
| tree | 35f473d8cd27e2f6262f184f707513a1cddf9532 | |
| parent | 83aca0e78727a870fb6aa788158920a1c8321541 (diff) | |
fix a test where list order was assumed
| -rw-r--r-- | nova/tests/test_db_api.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nova/tests/test_db_api.py b/nova/tests/test_db_api.py index 5ebab9cc8..aaf5212d0 100644 --- a/nova/tests/test_db_api.py +++ b/nova/tests/test_db_api.py @@ -92,6 +92,9 @@ class DbApiTestCase(test.TestCase): db.instance_destroy(self.context, inst1.id) result = db.instance_get_all_by_filters(self.context.elevated(), {}) self.assertEqual(2, len(result)) - self.assertEqual(result[0].id, inst1.id) - self.assertEqual(result[1].id, inst2.id) - self.assertTrue(result[0].deleted) + self.assertIn(inst1.id, [result[0].id, result[1].id]) + self.assertIn(inst2.id, [result[0].id, result[1].id]) + if inst1.id == result[0].id: + self.assertTrue(result[0].deleted) + else: + self.assertTrue(result[1].deleted) |
