summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kögl <stefan@skoegl.net>2013-07-11 18:25:37 +0200
committerStefan Kögl <stefan@skoegl.net>2013-07-11 18:25:37 +0200
commitb531ce1db69df4e290fda445edc85b8f135526fa (patch)
treedd188e3892bb283316e6a3f36879c869ad19a190
parent078ed6f153e1189ac051ee3820c6381fee41d12a (diff)
downloadpython-json-pointer-b531ce1db69df4e290fda445edc85b8f135526fa.tar.gz
add test for pointer string not starting with /
-rwxr-xr-xtests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests.py b/tests.py
index 8f86439..eaecc14 100755
--- a/tests.py
+++ b/tests.py
@@ -65,9 +65,19 @@ class ComparisonTests(unittest.TestCase):
# a pointer compares not-equal to objects of other types
self.assertFalse(p1 == "/something/1/b")
+
+class WrongInputTests(unittest.TestCase):
+
+ def test_no_start_slash(self):
+
+ # an exception is raised when the pointer string does not start with /
+ self.assertRaises(JsonPointerException, JsonPointer, 'some/thing')
+
+
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(SpecificationTests))
suite.addTest(unittest.makeSuite(ComparisonTests))
+suite.addTest(unittest.makeSuite(WrongInputTests))
modules = ['jsonpointer']