diff options
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r-- | tests/test_commands.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py index 2c1ebe6..0c5be9e 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -2912,6 +2912,16 @@ class TestRedisCommands: assert num == 4 assert r.lrange("sorted", 0, 10) == [b"vodka", b"milk", b"gin", b"apple juice"] + @skip_if_server_version_lt("7.0.0") + def test_sort_ro(self, r): + r["score:1"] = 8 + r["score:2"] = 3 + r["score:3"] = 5 + r.rpush("a", "3", "2", "1") + assert r.sort_ro("a", by="score:*") == [b"2", b"3", b"1"] + r.rpush("b", "2", "3", "1") + assert r.sort_ro("b", desc=True) == [b"3", b"2", b"1"] + def test_sort_issue_924(self, r): # Tests for issue https://github.com/andymccurdy/redis-py/issues/924 r.execute_command("SADD", "issue#924", 1) |