summaryrefslogtreecommitdiff
path: root/tests/test_asyncio/test_commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_asyncio/test_commands.py')
-rw-r--r--tests/test_asyncio/test_commands.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_asyncio/test_commands.py b/tests/test_asyncio/test_commands.py
index 7c6fd45..409934c 100644
--- a/tests/test_asyncio/test_commands.py
+++ b/tests/test_asyncio/test_commands.py
@@ -1710,6 +1710,15 @@ class TestRedisCommands:
assert await r.zrevrank("a", "a2") == 3
assert await r.zrevrank("a", "a6") is None
+ @skip_if_server_version_lt("7.2.0")
+ async def test_zrevrank_withscore(self, r: redis.Redis):
+ await r.zadd("a", {"a1": 1, "a2": 2, "a3": 3, "a4": 4, "a5": 5})
+ assert await r.zrevrank("a", "a1") == 4
+ assert await r.zrevrank("a", "a2") == 3
+ assert await r.zrevrank("a", "a6") is None
+ assert await r.zrevrank("a", "a3", withscore=True) == [2, "3"]
+ assert await r.zrevrank("a", "a6", withscore=True) is None
+
async def test_zscore(self, r: redis.Redis):
await r.zadd("a", {"a1": 1, "a2": 2, "a3": 3})
assert await r.zscore("a", "a1") == 1.0