From b531ce1db69df4e290fda445edc85b8f135526fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Thu, 11 Jul 2013 18:25:37 +0200 Subject: add test for pointer string not starting with / --- tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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'] -- cgit v1.2.1