diff options
author | Stefan Kögl <stefan@skoegl.net> | 2013-07-11 18:25:37 +0200 |
---|---|---|
committer | Stefan Kögl <stefan@skoegl.net> | 2013-07-11 18:25:37 +0200 |
commit | b531ce1db69df4e290fda445edc85b8f135526fa (patch) | |
tree | dd188e3892bb283316e6a3f36879c869ad19a190 /tests.py | |
parent | 078ed6f153e1189ac051ee3820c6381fee41d12a (diff) | |
download | python-json-pointer-b531ce1db69df4e290fda445edc85b8f135526fa.tar.gz |
add test for pointer string not starting with /
Diffstat (limited to 'tests.py')
-rwxr-xr-x | tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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'] |