summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kögl <stefan@skoegl.net>2013-07-12 19:44:53 +0200
committerStefan Kögl <stefan@skoegl.net>2013-07-12 19:44:53 +0200
commitbdd3689fbd8aa30e1770c676de91047bc4883e6c (patch)
tree279f762131fb03b1cd9900f45cc07b5bd5260744
parent35721f962ee05e86482a348c8530138e699542ee (diff)
downloadpython-json-patch-bdd3689fbd8aa30e1770c676de91047bc4883e6c.tar.gz
test for repace outside of list
-rwxr-xr-xtests.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests.py b/tests.py
index 9b58cfe..934b2d0 100755
--- a/tests.py
+++ b/tests.py
@@ -318,7 +318,10 @@ class ConflictTests(unittest.TestCase):
patch_obj = [ { "op": "move", "from": "/foo", "path": "/foo/bar" } ]
self.assertRaises(jsonpatch.JsonPatchException, jsonpatch.apply_patch, src, patch_obj)
-
+ def test_replace_oob(self):
+ src = {"foo": [1, 2]}
+ patch_obj = [ { "op": "replace", "path": "/foo/10", "value": 10} ]
+ self.assertRaises(jsonpatch.JsonPatchConflict, jsonpatch.apply_patch, src, patch_obj)
modules = ['jsonpatch']