From f28a9f589371e8967871998b7972c3755bb622b1 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Wed, 21 Dec 2022 13:19:47 +0200 Subject: Fix `JSON.ARRINDEX` test (#2527) * Fix test json.arrindex * linters * linters --- tests/test_json.py | 15 ++++----------- 1 file 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 -- cgit v1.2.1