From 0d30f12f3f64dbe58bd816597856fb34d9e31fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Sat, 28 Oct 2017 12:46:41 +0200 Subject: Perform input validation in JsonPoiner --- tests.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests.py') diff --git a/tests.py b/tests.py index 21483eb..54ca436 100755 --- a/tests.py +++ b/tests.py @@ -126,6 +126,12 @@ class WrongInputTests(unittest.TestCase): doc = [0, 1, 2] self.assertRaises(JsonPointerException, resolve_pointer, doc, '/10') + def test_trailing_escape(self): + self.assertRaises(JsonPointerException, JsonPointer, '/foo/bar~') + + def test_invalid_escape(self): + self.assertRaises(JsonPointerException, JsonPointer, '/foo/bar~2') + class ToLastTests(unittest.TestCase): -- cgit v1.2.1