summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kögl <stefan@skoegl.net>2013-07-12 19:46:57 +0200
committerStefan Kögl <stefan@skoegl.net>2013-07-12 19:46:57 +0200
commit7d0e0faeedbff07a597409be4e5607547944242b (patch)
treef96222f623ab16bf5da15b686ce618fb1174787f
parentbdd3689fbd8aa30e1770c676de91047bc4883e6c (diff)
downloadpython-json-patch-7d0e0faeedbff07a597409be4e5607547944242b.tar.gz
add test for replacing missing obj
-rwxr-xr-xtests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests.py b/tests.py
index 934b2d0..3fbffbb 100755
--- a/tests.py
+++ b/tests.py
@@ -323,6 +323,12 @@ 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_missing(self):
+ src = {"foo": 1}
+ patch_obj = [ { "op": "replace", "path": "/bar", "value": 10} ]
+ self.assertRaises(jsonpatch.JsonPatchConflict, jsonpatch.apply_patch, src, patch_obj)
+
+
modules = ['jsonpatch']