summaryrefslogtreecommitdiff
path: root/tests.py
diff options
context:
space:
mode:
authorStefan Kögl <stefan@skoegl.net>2021-03-29 22:06:00 +0200
committerGitHub <noreply@github.com>2021-03-29 22:06:00 +0200
commita6526489c4b741e1b603b5bb988ecc9aefd3e880 (patch)
tree80c5d507a176ace16f23ccc6be3effce91c01064 /tests.py
parent55d4816975350ea3f683814f4d025951ddfb1693 (diff)
parentc9bfb91727690d6c7249b9250aba8942613f3f1c (diff)
downloadpython-json-patch-a6526489c4b741e1b603b5bb988ecc9aefd3e880.tar.gz
Merge pull request #132 from JulienPalard/mdk/TypeError
FIX: TypeError when one forgot to put its operation in a list.
Diffstat (limited to 'tests.py')
-rwxr-xr-xtests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests.py b/tests.py
index 8a638cf..797c220 100755
--- a/tests.py
+++ b/tests.py
@@ -190,6 +190,12 @@ class ApplyPatchTestCase(unittest.TestCase):
obj, [{'op': 'test', 'path': '/baz', 'value': 'bar'}])
+ def test_forgetting_surrounding_list(self):
+ obj = {'bar': 'qux'}
+ self.assertRaises(jsonpatch.InvalidJsonPatch,
+ jsonpatch.apply_patch,
+ obj, {'op': 'test', 'path': '/bar'})
+
def test_test_noval_existing(self):
obj = {'bar': 'qux'}
self.assertRaises(jsonpatch.InvalidJsonPatch,