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:
parent
649b4e1682
commit
7388d92115
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue