Merge "Use specific key to sort list of dicts"

This commit is contained in:
Jenkins 2016-03-01 01:51:03 +00:00 committed by Gerrit Code Review
commit a463d07616
1 changed files with 2 additions and 1 deletions

View File

@ -89,7 +89,8 @@ class TestJsonPatchType(base.FunctionalTest):
{'path': '/foo', 'op': 'replace', 'value': 'bar'}]
ret = self._patch_json(valid_patches, False)
self.assertEqual(200, ret.status_int)
self.assertEqual(sorted(valid_patches), sorted(ret.json))
self.assertEqual(sorted(valid_patches, key=lambda k: k['op']),
sorted(ret.json, key=lambda k: k['op']))
def test_cannot_update_internal_attr(self):
patch = [{'path': '/internal', 'op': 'replace', 'value': 'foo'}]