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