Skip to content

Commit b531ce1

Browse files
committed
add test for pointer string not starting with /
1 parent 078ed6f commit b531ce1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,19 @@ def test_eq_hash(self):
6565
# a pointer compares not-equal to objects of other types
6666
self.assertFalse(p1 == "/something/1/b")
6767

68+
69+
class WrongInputTests(unittest.TestCase):
70+
71+
def test_no_start_slash(self):
72+
73+
# an exception is raised when the pointer string does not start with /
74+
self.assertRaises(JsonPointerException, JsonPointer, 'some/thing')
75+
76+
6877
suite = unittest.TestSuite()
6978
suite.addTest(unittest.makeSuite(SpecificationTests))
7079
suite.addTest(unittest.makeSuite(ComparisonTests))
80+
suite.addTest(unittest.makeSuite(WrongInputTests))
7181

7282
modules = ['jsonpointer']
7383

0 commit comments

Comments
 (0)