summaryrefslogtreecommitdiff
path: root/tests.py
diff options
context:
space:
mode:
authorIgor Tkach <igor.tkach@percolate.com>2019-06-28 13:08:03 -0400
committerIgor Tkach <igor.tkach@percolate.com>2019-06-28 13:09:20 -0400
commit1b83d63088d0af707c4cb1361001ea3cf714a38a (patch)
tree35516dc90ded56f6e265901d2dd499465e9b041b /tests.py
parent2990bb3d686c09a1550083336365e99247297711 (diff)
downloadpython-json-patch-1b83d63088d0af707c4cb1361001ea3cf714a38a.tar.gz
Fix move for numeric dictionary keys (issue #97)
Diffstat (limited to 'tests.py')
-rwxr-xr-xtests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests.py b/tests.py
index cd39b3b..07f923b 100755
--- a/tests.py
+++ b/tests.py
@@ -419,6 +419,15 @@ class MakePatchTestCase(unittest.TestCase):
new_from_patch = jsonpatch.apply_patch(old, patch)
self.assertEqual(new, new_from_patch)
+ def test_move_from_numeric_to_alpha_dict_key(self):
+ #https://github.com/stefankoegl/python-json-patch/issues/97
+ src = {'13': 'x'}
+ dst = {'A': 'a', 'b': 'x'}
+ patch = jsonpatch.make_patch(src, dst)
+ res = jsonpatch.apply_patch(src, patch)
+ self.assertEqual(res, dst)
+
+
class OptimizationTests(unittest.TestCase):
def test_use_replace_instead_of_remove_add(self):