Skip to content

Commit

Permalink
Added handling of RESP3 responses
Browse files Browse the repository at this point in the history
  • Loading branch information
vladvildanov committed Dec 26, 2024
1 parent b54c3d8 commit 45d5d71
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -2678,7 +2678,10 @@ def test_vector_search_with_default_dialect(client):
assert 2 in q.get_args()

res = client.ft().search(q, query_params={"vec": "aaaaaaaa"})
assert res.total == 2
if is_resp2_connection(client):
assert res.total == 2
else:
assert res["total_results"] == 2


@pytest.mark.redismod
Expand All @@ -2696,13 +2699,19 @@ def test_search_query_with_different_dialects(client):
query = "@name: James Brown"
q = Query(query)
res = client.ft().search(q)
assert res.total == 1
if is_resp2_connection(client):
assert res.total == 1
else:
assert res["total_results"] == 1

# Query with explicit DIALECT 1
query = "@name: James Brown"
q = Query(query).dialect(1)
res = client.ft().search(q)
assert res.total == 0
if is_resp2_connection(client):
assert res.total == 0
else:
assert res["total_results"] == 0


def _assert_search_result(client, result, expected_doc_ids):
Expand Down

0 comments on commit 45d5d71

Please sign in to comment.