Correct catalog response checker for result ordering

The order of the catalog links list will vary depending on how a query
returns results and the order of the keys returned by keys() may also
vary. This can be seen by setting the PYTHONHASHSEED value to
something other than 0.

With this fix, the links and response keys are compared using a set
equals so the order doesn't matter.

Change-Id: If4a606ce45425c5fa51c6e76bf9172cccaf7a427
Partial-Bug: #1348818
This commit is contained in:
Brant Knudson 2014-12-03 18:55:23 -06:00
parent 649b4e1682
commit 7388d92115
1 changed files with 1 additions and 1 deletions

View File

@ -753,7 +753,7 @@ class RestfulTestCase(tests.SQLDriverOverrides, rest.RestfulTestCase,
# catalog validation
def assertValidCatalogResponse(self, resp, *args, **kwargs):
self.assertEqual(['catalog', 'links'], resp.json.keys())
self.assertEqual(set(['catalog', 'links']), set(resp.json.keys()))
self.assertValidCatalog(resp.json['catalog'])
self.assertIn('links', resp.json)
self.assertIsInstance(resp.json['links'], dict)