summaryrefslogtreecommitdiff
path: root/tests/test_asyncio/test_search.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_asyncio/test_search.py')
-rw-r--r--tests/test_asyncio/test_search.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_asyncio/test_search.py b/tests/test_asyncio/test_search.py
index 88c80d3..12313b6 100644
--- a/tests/test_asyncio/test_search.py
+++ b/tests/test_asyncio/test_search.py
@@ -1001,3 +1001,12 @@ async def test_search_commands_in_pipeline(modclient: redis.Redis):
assert "doc2" == res[3][4]
assert res[3][5] is None
assert res[3][3] == res[3][6] == ["txt", "foo bar"]
+
+
+@pytest.mark.redismod
+async def test_query_timeout(modclient: redis.Redis):
+ q1 = Query("foo").timeout(5000)
+ assert q1.get_args() == ["foo", "TIMEOUT", 5000, "LIMIT", 0, 10]
+ q2 = Query("foo").timeout("not_a_number")
+ with pytest.raises(redis.ResponseError):
+ await modclient.ft().search(q2)