summaryrefslogtreecommitdiff
path: root/tests/test_commands.py
diff options
context:
space:
mode:
authordvora-h <67596500+dvora-h@users.noreply.github.com>2022-03-14 15:57:58 +0200
committerGitHub <noreply@github.com>2022-03-14 15:57:58 +0200
commit4b2247645443ba27a3f5dc65a92735a406bac9f8 (patch)
tree280f5b544f5e33a6c7c5defc2f81830996cd73f1 /tests/test_commands.py
parent160a7f6b951d2a11c17431cab34ee0457e128218 (diff)
downloadredis-py-4b2247645443ba27a3f5dc65a92735a406bac9f8.tar.gz
Add support for SORT_RO (#1858)
* add sort_ro * mark test as onlynon cluster * delete mark test as onlynoncluster * skip test
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r--tests/test_commands.py10
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)