Skip to content

Commit 8cacb50

Browse files
author
dlacher
committed
updated unittests
1 parent 2492593 commit 8cacb50

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_jsonpath_rw_ext.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ class Testjsonpath_ng_ext(testscenarios.WithScenarios,
9696
('len_list', dict(string='objects.`len`',
9797
data={'objects': ['alpha', 'gamma', 'beta']},
9898
target=3)),
99+
('filter_list', dict(string='objects[?@="alpha"]',
100+
data={'objects': ['alpha', 'gamma', 'beta']},
101+
target=['alpha'])),
102+
('filter_list_2', dict(string='objects[?@ ~= "a.+"]',
103+
data={'objects': ['alpha', 'gamma', 'beta']},
104+
target=['alpha','gamma'])),
99105
('keys_list', dict(string='objects.`keys`',
100106
data={'objects': ['alpha', 'gamma', 'beta']},
101107
target=[])),
@@ -105,6 +111,10 @@ class Testjsonpath_ng_ext(testscenarios.WithScenarios,
105111
('keys_dict', dict(string='objects.`keys`',
106112
data={'objects': {'cow': 'moo', 'cat': 'neigh'}},
107113
target=['cow','cat'])),
114+
#('filter_keys_dict', dict(string='objects.`keys`[?`this`="cow"]',
115+
# data={'objects': {'cow': 'moo', 'cat': 'neigh'}},
116+
# target=['cow'])),
117+
#TODO make keys dictionaries filterable
108118
('len_str', dict(string='objects[0].`len`',
109119
data={'objects': ['alpha', 'gamma']},
110120
target=5)),

0 commit comments

Comments
 (0)