@@ -96,6 +96,12 @@ class Testjsonpath_ng_ext(testscenarios.WithScenarios,
96
96
('len_list' , dict (string = 'objects.`len`' ,
97
97
data = {'objects' : ['alpha' , 'gamma' , 'beta' ]},
98
98
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' ])),
99
105
('keys_list' , dict (string = 'objects.`keys`' ,
100
106
data = {'objects' : ['alpha' , 'gamma' , 'beta' ]},
101
107
target = [])),
@@ -105,6 +111,10 @@ class Testjsonpath_ng_ext(testscenarios.WithScenarios,
105
111
('keys_dict' , dict (string = 'objects.`keys`' ,
106
112
data = {'objects' : {'cow' : 'moo' , 'cat' : 'neigh' }},
107
113
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
108
118
('len_str' , dict (string = 'objects[0].`len`' ,
109
119
data = {'objects' : ['alpha' , 'gamma' ]},
110
120
target = 5 )),
0 commit comments