8000 Add tests for `parent` named operator · 0xdecaf/python-jsonpath-rw@f8e2c27 · GitHub
[go: up one dir, main page]

Skip to content

Commit f8e2c27

Browse files
committed
Add tests for parent named operator
1 parent 380184c commit f8e2c27

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_jsonpath.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ def test_descendants_value(self):
157157
('foo..baz', {'foo': [{'baz': 1}, {'baz': 2}]}, [1, 2] ),
158158
])
159159

160+
def test_parent_value(self):
161+
self.check_cases([('foo.baz.`parent`', {'foo': {'baz': 3}}, [{'baz': 3}]),
162+
('foo.`parent`.foo.baz.`parent`.baz.bizzle', {'foo': {'baz': {'bizzle': 5}}}, [5])])
163+
160164
#
161165
# Check that the paths for the data are correct.
162166
# FIXME: merge these tests with the above, since the inputs are the same anyhow

0 commit comments

Comments
 (0)
0