summaryrefslogtreecommitdiff
path: root/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests.py')
-rwxr-xr-xtests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests.py b/tests.py
index cde90b0..0abf4d2 100755
--- a/tests.py
+++ b/tests.py
@@ -219,6 +219,17 @@ class ApplyPatchTestCase(unittest.TestCase):
])
self.assertEqual(res['foo'], [1, 2, 3, 4])
+ def test_add_missing_path(self):
+ obj = {'bar': 'qux'}
+ self.assertRaises(jsonpatch.InvalidJsonPatch,
+ jsonpatch.apply_patch,
+ obj, [{'op': 'test', 'value': 'bar'}])
+
+ def test_path_with_null_value(self):
+ obj = {'bar': 'qux'}
+ self.assertRaises(jsonpatch.InvalidJsonPatch,
+ jsonpatch.apply_patch,
+ obj, '[{"op": "add", "path": null, "value": "bar"}]')
class EqualityTestCase(unittest.TestCase):