Skip to content

Commit ed43114

Browse files
author
Jonathan Hilliard
committed
Test to reproduce:
#90 #103
1 parent 3e44e04 commit ed43114

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,24 @@ def test_move_from_numeric_to_alpha_dict_key(self):
427427
res = jsonpatch.apply_patch(src, patch)
428428
self.assertEqual(res, dst)
429429

430+
def test_issue90(self):
431+
"""In JSON 1 is different from True even though in python 1 == True"""
432+
src = {'A': 1}
433+
dst = {'A': True}
434+
patch = jsonpatch.make_patch(src, dst)
435+
res = jsonpatch.apply_patch(src, patch)
436+
self.assertEqual(res, dst)
437+
self.assertIsInstance(res['A'], bool)
438+
439+
def test_issue103(self):
440+
"""In JSON 1 is different from 1.0 even though in python 1 == 1.0"""
441+
src = {'A': 1}
442+
dst = {'A': 1.0}
443+
patch = jsonpatch.make_patch(src, dst)
444+
res = jsonpatch.apply_patch(src, patch)
445+
self.assertEqual(res, dst)
446+
self.assertIsInstance(res['A'], float)
447+
430448

431449

432450
class OptimizationTests(unittest.TestCase):

0 commit comments

Comments
 (0)