diff options
author | Stefan Kögl <stefan@skoegl.net> | 2013-07-11 18:37:53 +0200 |
---|---|---|
committer | Stefan Kögl <stefan@skoegl.net> | 2013-07-11 18:37:53 +0200 |
commit | 8b2c8fe52803be008fc5f16ef5a4ebbebbc6482b (patch) | |
tree | 30153589c12fbda5f3fd257b7b836eedc061b6dc | |
parent | b531ce1db69df4e290fda445edc85b8f135526fa (diff) | |
download | python-json-pointer-8b2c8fe52803be008fc5f16ef5a4ebbebbc6482b.tar.gz |
add test for invalid list index
-rwxr-xr-x | tests.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -69,10 +69,15 @@ class ComparisonTests(unittest.TestCase): 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') + def test_invalid_index(self): + # 'a' is not a valid list index + doc = [0, 1, 2] + self.assertRaises(JsonPointerException, resolve_pointer, doc, '/a') + + suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(SpecificationTests)) |