summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordvora-h <67596500+dvora-h@users.noreply.github.com>2022-12-21 13:19:47 +0200
committerGitHub <noreply@github.com>2022-12-21 13:19:47 +0200
commitf28a9f589371e8967871998b7972c3755bb622b1 (patch)
treeed199b8972299e184e57c7c0b552c1c5ad7296e0
parent74c251a19d211b3dcf555adc4a68bdc6f097f763 (diff)
downloadredis-py-f28a9f589371e8967871998b7972c3755bb622b1.tar.gz
Fix `JSON.ARRINDEX` test (#2527)
* Fix test json.arrindex * linters * linters
-rw-r--r--tests/test_json.py15
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