Commit ad70586 1 parent 699fe9e commit ad70586 Copy full SHA for ad70586
File tree 1 file changed +26
-1
lines changed
1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,18 @@ def test_tolerance_jsonpath_must_match_expected_value():
139
139
}
140
140
) is True
141
141
142
+ t = {
143
+ "type" : "jsonpath" ,
144
+ "path" : "$.foo[?(@.baz)].baz" ,
145
+ "expect" : [["hello" , "bonjour" ]],
146
+ "expect_alt" : [["hello" , "joe" ]]
147
+ }
148
+ ensure_hypothesis_tolerance_is_valid (t )
149
+ assert within_tolerance (
150
+ t , value = {
151
+ 'foo' : {"baz" : ["hello" , "joe" ]}
152
+ }
153
+ ) is True
142
154
143
155
t = {
144
156
"type" : "jsonpath" ,
@@ -152,6 +164,19 @@ def test_tolerance_jsonpath_must_match_expected_value():
152
164
}
153
165
) is True
154
166
167
+ t = {
168
+ "type" : "jsonpath" ,
169
+ "path" : "$.foo[?(@.baz)].baz" ,
170
+ "expect" : [[["hello" ], ["bonjour" ]]],
171
+ "expect_alt" : [[["hello" ], ["joe" ]]]
172
+ }
173
+ ensure_hypothesis_tolerance_is_valid (t )
174
+ assert within_tolerance (
175
+ t , value = {
176
+ 'foo' : {"baz" : [["hello" ], ["joe" ]]}
177
+ }
178
+ ) is True
179
+
155
180
t = {
156
181
"type" : "jsonpath" ,
157
182
"path" : "$.foo[?(@.baz)].baz" ,
@@ -201,7 +226,7 @@ def test_tolerance_jsonpath_must_match_expected_values():
201
226
assert within_tolerance (
202
227
t , value = {
203
228
'foo' : [{"baz" : "hello" }, {"baz" : "bonjour" }]
204
- },
229
+ },
205
230
) is True
206
231
207
232
You can’t perform that action at this time.
0 commit comments