summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenn Knowles <kenn.knowles@gmail.com>2013-06-14 18:07:05 -0400
committerKenn Knowles <kenn.knowles@gmail.com>2013-06-14 18:07:05 -0400
commitf8e2c27f4f744444c85911499422b4f024813f2b (patch)
treef9521cb695a1e877cd902d8a026505753f47ce57
parent380184cf8a014e4e85de7ae19d2286dcaaa570bc (diff)
downloadjsonpath-rw-f8e2c27f4f744444c85911499422b4f024813f2b.tar.gz
Add tests for `parent` named operator
-rw-r--r--tests/test_jsonpath.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_jsonpath.py b/tests/test_jsonpath.py
index c97c096..0c496cc 100644
--- a/tests/test_jsonpath.py
+++ b/tests/test_jsonpath.py
@@ -157,6 +157,10 @@ class TestJsonPath(unittest.TestCase):
('foo..baz', {'foo': [{'baz': 1}, {'baz': 2}]}, [1, 2] ),
])
+ def test_parent_value(self):
+ self.check_cases([('foo.baz.`parent`', {'foo': {'baz': 3}}, [{'baz': 3}]),
+ ('foo.`parent`.foo.baz.`parent`.baz.bizzle', {'foo': {'baz': {'bizzle': 5}}}, [5])])
+
#
# Check that the paths for the data are correct.
# FIXME: merge these tests with the above, since the inputs are the same anyhow