Merge "Use specific key to sort list of dicts"
This commit is contained in:
commit
a463d07616
|
@ -89,7 +89,8 @@ class TestJsonPatchType(base.FunctionalTest):
|
||||||
{'path': '/foo', 'op': 'replace', 'value': 'bar'}]
|
{'path': '/foo', 'op': 'replace', 'value': 'bar'}]
|
||||||
ret = self._patch_json(valid_patches, False)
|
ret = self._patch_json(valid_patches, False)
|
||||||
self.assertEqual(200, ret.status_int)
|
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):
|
def test_cannot_update_internal_attr(self):
|
||||||
patch = [{'path': '/internal', 'op': 'replace', 'value': 'foo'}]
|
patch = [{'path': '/internal', 'op': 'replace', 'value': 'foo'}]
|
||||||
|
|
Loading…
Reference in New Issue