diff options
author | Stefan Kögl <stefan@skoegl.net> | 2012-11-08 15:55:45 +0100 |
---|---|---|
committer | Stefan Kögl <stefan@skoegl.net> | 2012-11-08 15:55:45 +0100 |
commit | 16d29f8fa10664a92f27b47d617260f0e5d13b9a (patch) | |
tree | 90aa95a21273e2d669a931130232f1f2e655f935 /tests.py | |
parent | 97a06ecb9dde82bd54dc269052841035ca2a1390 (diff) | |
download | python-json-pointer-16d29f8fa10664a92f27b47d617260f0e5d13b9a.tar.gz |
update jsonpointer to current spec
http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-05
Diffstat (limited to 'tests.py')
-rwxr-xr-x | tests.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -4,7 +4,7 @@ import doctest import unittest import sys -from jsonpointer import resolve_pointer +from jsonpointer import resolve_pointer, EndOfList, JsonPointerException class SpecificationTests(unittest.TestCase): """ Tests all examples from the JSON Pointer specification """ @@ -37,6 +37,14 @@ class SpecificationTests(unittest.TestCase): self.assertEqual(resolve_pointer(doc, "/m~0n"), 8) + def test_eol(self): + doc = { + "foo": ["bar", "baz"] + } + + self.assertTrue(isinstance(resolve_pointer(doc, "/foo/-"), EndOfList)) + self.assertRaises(JsonPointerException, resolve_pointer, doc, "/foo/-/1") + modules = ['jsonpointer'] |