diff options
author | dvora-h <67596500+dvora-h@users.noreply.github.com> | 2022-12-21 13:19:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-21 13:19:47 +0200 |
commit | f28a9f589371e8967871998b7972c3755bb622b1 (patch) | |
tree | ed199b8972299e184e57c7c0b552c1c5ad7296e0 /tests/test_json.py | |
parent | 74c251a19d211b3dcf555adc4a68bdc6f097f763 (diff) | |
download | redis-py-f28a9f589371e8967871998b7972c3755bb622b1.tar.gz |
Fix `JSON.ARRINDEX` test (#2527)
* Fix test json.arrindex
* linters
* linters
Diffstat (limited to 'tests/test_json.py')
-rw-r--r-- | tests/test_json.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/tests/test_json.py b/tests/test_json.py index 676683d..a776e9e 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -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 |