diff options
author | Stefan Kögl <stefan@skoegl.net> | 2013-07-12 19:44:53 +0200 |
---|---|---|
committer | Stefan Kögl <stefan@skoegl.net> | 2013-07-12 19:44:53 +0200 |
commit | bdd3689fbd8aa30e1770c676de91047bc4883e6c (patch) | |
tree | 279f762131fb03b1cd9900f45cc07b5bd5260744 /tests.py | |
parent | 35721f962ee05e86482a348c8530138e699542ee (diff) | |
download | python-json-patch-bdd3689fbd8aa30e1770c676de91047bc4883e6c.tar.gz |
test for repace outside of list
Diffstat (limited to 'tests.py')
-rwxr-xr-x | tests.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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'] |