Skip to content

Add TIMEOUT to query class #2519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge tests
  • Loading branch information
shacharPash committed Dec 19, 2022
commit d0c963594ebe12117fcdf90c51f02ed4ca52004f
10 changes: 3 additions & 7 deletions tests/test_asyncio/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,13 +1004,9 @@ async def test_search_commands_in_pipeline(modclient: redis.Redis):


@pytest.mark.redismod
def test_timeout():
def test_query_timeout(modclient: redis.Redis):
q1 = Query("foo").timeout(5000)
assert q1.get_args() == ["foo", "TIMEOUT", 5000, "LIMIT", 0, 10]


@pytest.mark.redismod
def test_not_number_timeout(modclient: redis.Redis):
q1 = Query("foo").timeout("not a number")
with pytest.raises(Exception):
q2 = Query("foo").timeout("500")
with pytest.raises(redis.exceptions.ResponseError):
modclient.ft().search(q1)
10 changes: 3 additions & 7 deletions tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -1618,13 +1618,9 @@ def test_withsuffixtrie(modclient: redis.Redis):


@pytest.mark.redismod
def test_timeout():
def test_query_timeout(modclient: redis.Redis):
q1 = Query("foo").timeout(5000)
assert q1.get_args() == ["foo", "TIMEOUT", 5000, "LIMIT", 0, 10]


@pytest.mark.redismod
def test_not_number_timeout(modclient: redis.Redis):
q1 = Query("foo").timeout("not a number")
with pytest.raises(Exception):
q2 = Query("foo").timeout("500")
with pytest.raises(redis.exceptions.ResponseError):
modclient.ft().search(q1)