summaryrefslogtreecommitdiff
path: root/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests.py')
-rwxr-xr-xtests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests.py b/tests.py
index 07f923b..28f0201 100755
--- a/tests.py
+++ b/tests.py
@@ -611,6 +611,11 @@ class ConflictTests(unittest.TestCase):
patch_obj = [ { "op": "replace", "path": "/foo/10", "value": 10} ]
self.assertRaises(jsonpatch.JsonPatchConflict, jsonpatch.apply_patch, src, patch_obj)
+ def test_replace_oob_length(self):
+ src = {"foo": [0, 1]}
+ patch_obj = [ { "op": "replace", "path": "/foo/2", "value": 2} ]
+ self.assertRaises(jsonpatch.JsonPatchConflict, jsonpatch.apply_patch, src, patch_obj)
+
def test_replace_missing(self):
src = {"foo": 1}
patch_obj = [ { "op": "replace", "path": "/bar", "value": 10} ]