From 3b10ba68dd5b8ec996901ad8b9c2ab9709ca04bf Mon Sep 17 00:00:00 2001 From: dvora-h Date: Wed, 21 Dec 2022 12:18:08 +0200 Subject: [PATCH 1/3] Fix test json.arrindex --- tests/test_json.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/test_json.py b/tests/test_json.py index 676683d9f7..5ff1fc9bf7 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -1326,14 +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 + # Test with none-scalar value assert ( client.json().arrindex( - "test_None", ".[4][1].nested42_empty_arr.arr", '{"arr":[]}' + "test_None", "$..nested42_empty_arr.arr", {"arr": []} ) == -1 ) From a70e6bc586bee6d9f025723f840f8e0471664ce3 Mon Sep 17 00:00:00 2001 From: dvora-h Date: Wed, 21 Dec 2022 12:32:26 +0200 Subject: [PATCH 2/3] linters --- tests/test_json.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test_json.py b/tests/test_json.py index 5ff1fc9bf7..8211c41ce3 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -1328,10 +1328,8 @@ def test_arrindex_dollar(client): # Test with none-scalar value assert ( - client.json().arrindex( - "test_None", "$..nested42_empty_arr.arr", {"arr": []} - ) - == -1 + client.json().arrindex("test_None", "$..nested42_empty_arr.arr", {"arr": []}) + == [-1] ) # Test legacy (path begins with dot) From 17cd99ae3d37184d7a7bddc0f189172670b20c4e Mon Sep 17 00:00:00 2001 From: dvora-h Date: Wed, 21 Dec 2022 12:40:33 +0200 Subject: [PATCH 3/3] linters --- tests/test_json.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_json.py b/tests/test_json.py index 8211c41ce3..a776e9e736 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -1327,10 +1327,9 @@ def test_arrindex_dollar(client): ] # Test with none-scalar value - assert ( - client.json().arrindex("test_None", "$..nested42_empty_arr.arr", {"arr": []}) - == [-1] - ) + 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