summaryrefslogtreecommitdiff
path: root/tests/test_search.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_search.py')
-rw-r--r--tests/test_search.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_search.py b/tests/test_search.py
index 08c76f7..12876f6 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -1615,3 +1615,12 @@ def test_withsuffixtrie(modclient: redis.Redis):
waitForIndex(modclient, getattr(modclient.ft(), "index_name", "idx"))
info = modclient.ft().info()
assert "WITHSUFFIXTRIE" in info["attributes"][0]
+
+
+@pytest.mark.redismod
+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):
+ modclient.ft().search(q2)