summaryrefslogtreecommitdiff
path: root/tests/test_commands.py
diff options
context:
space:
mode:
authordvora-h <67596500+dvora-h@users.noreply.github.com>2022-02-06 10:19:36 +0200
committerGitHub <noreply@github.com>2022-02-06 10:19:36 +0200
commita87a750ed1a39138ba4526537335012fc95142c9 (patch)
treeb9a1bedbaa787129b2154935a0f9bdabb0757b14 /tests/test_commands.py
parent9442d34beb8254aebe87b9b48ef7e627e1079837 (diff)
downloadredis-py-a87a750ed1a39138ba4526537335012fc95142c9.tar.gz
Add support for ZMPOP (#1923)
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r--tests/test_commands.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py
index c8f7ddc..a2d9335 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -2108,6 +2108,17 @@ class TestRedisCommands:
@pytest.mark.onlynoncluster
# @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
+ def test_zmpop(self, unstable_r):
+ unstable_r.zadd("a", {"a1": 1, "a2": 2, "a3": 3})
+ res = [b"a", [[b"a1", b"1"], [b"a2", b"2"]]]
+ assert unstable_r.zmpop("2", ["b", "a"], min=True, count=2) == res
+ with pytest.raises(redis.DataError):
+ unstable_r.zmpop("2", ["b", "a"], count=2)
+ unstable_r.zadd("b", {"b1": 10, "ab": 9, "b3": 8})
+ assert unstable_r.zmpop("2", ["b", "a"], max=True) == [b"b", [[b"b1", b"10"]]]
+
+ @pytest.mark.onlynoncluster
+ # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
def test_bzmpop(self, unstable_r):
unstable_r.zadd("a", {"a1": 1, "a2": 2, "a3": 3})
res = [b"a", [[b"a1", b"1"], [b"a2", b"2"]]]