We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66c4fa4 commit 282bebaCopy full SHA for 282beba
tests.py
@@ -327,13 +327,17 @@ def test_use_move_instead_of_remove_add(self):
327
self.assertEqual(res, dst)
328
329
def test_use_move_instead_of_add_remove(self):
330
- src = {'foo': [1, 2, 3]}
331
- dst = {'foo': [3, 1, 2]}
332
- patch = list(jsonpatch.make_patch(src, dst))
333
- self.assertEqual(len(patch), 1)
334
- self.assertEqual(patch[0]['op'], 'move')
335
- res = jsonpatch.apply_patch(src, patch)
336
- self.assertEqual(res, dst)
+ def fn(_src, _dst):
+ patch = list(jsonpatch.make_patch(_src, _dst))
+ self.assertEqual(len(patch), 1)
+ self.assertEqual(patch[0]['op'], 'move')
+ res = jsonpatch.apply_patch(_src, patch)
+ self.assertEqual(res, _dst)
+
337
+ fn({'foo': [1, 2, 3]}, {'foo': [3, 1, 2]})
338
+ fn({'foo': [1, 2, 3]}, {'foo': [3, 2, 1]})
339
+ fn([1, 2, 3], [3, 1, 2])
340
+ fn([1, 2, 3], [3, 2, 1])
341
342
def test_escape(self):
343
src = {"x/y": 1}
0 commit comments