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 04596b8 commit ae895f7Copy full SHA for ae895f7
tests.py
@@ -398,6 +398,16 @@ def test_list_in_dict(self):
398
new_from_patch = jsonpatch.apply_patch(old, patch)
399
self.assertEqual(new, new_from_patch)
400
401
+ def test_nested(self):
402
+ """ Patch creation with nested dicts, as reported in #41
403
+
404
+ https://github.com/stefankoegl/python-json-patch/issues/41 """
405
+ old = {'school':{'names':['Kevin','Carl']}}
406
+ new = {'school':{'names':['Carl','Kate','Kevin','Jake']}}
407
+ patch = jsonpatch.JsonPatch.from_diff(old, new)
408
+ new_from_patch = jsonpatch.apply_patch(old, patch)
409
+ self.assertEqual(new, new_from_patch)
410
411
412
class OptimizationTests(unittest.TestCase):
413
def test_use_replace_instead_of_remove_add(self):
0 commit comments