Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -1326,17 +1326,10 @@ def test_arrindex_dollar(client):
[],
]

# Fail with none-scalar value
with pytest.raises(exceptions.ResponseError):
client.json().arrindex("test_None", "$..nested42_empty_arr.arr", {"arr": []})

# Do not fail with none-scalar value in legacy mode
assert (
client.json().arrindex(
"test_None", ".[4][1].nested42_empty_arr.arr", '{"arr":[]}'
)
== -1
)
# Test with none-scalar value
assert client.json().arrindex(
"test_None", "$..nested42_empty_arr.arr", {"arr": []}
) == [-1]

# Test legacy (path begins with dot)
# Test index of int scalar in single value
Expand Down