summaryrefslogtreecommitdiff
path: root/tests/test_commands.py
diff options
context:
space:
mode:
authordvora-h <67596500+dvora-h@users.noreply.github.com>2022-02-02 14:50:46 +0200
committerGitHub <noreply@github.com>2022-02-02 14:50:46 +0200
commit4d7de6df66733dc85baa6235a122747dfe463b9a (patch)
treef6709e332a67dc27f52976a613b1daab72cd23e7 /tests/test_commands.py
parentaaddeb6a9c0d2fcacf240c5ace7ba76fddee2fc1 (diff)
downloadredis-py-4d7de6df66733dc85baa6235a122747dfe463b9a.tar.gz
Add support for BLMPOP (#1849)
* Add support for BLMPOP * add type hints * fix test * fix comment * fix pr comment * delete count check * change numkeys * linters * mark test as onlynoncluster
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r--tests/test_commands.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py
index ed69c40..c8f7ddc 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -1482,6 +1482,18 @@ class TestRedisCommands:
@pytest.mark.onlynoncluster
# @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
+ def test_blmpop(self, unstable_r):
+ unstable_r.rpush("a", "1", "2", "3", "4", "5")
+ res = [b"a", [b"1", b"2"]]
+ assert unstable_r.blmpop(1, "2", "b", "a", direction="LEFT", count=2) == res
+ with pytest.raises(TypeError):
+ unstable_r.blmpop(1, "2", "b", "a", count=2)
+ unstable_r.rpush("b", "6", "7", "8", "9")
+ assert unstable_r.blmpop(0, "2", "b", "a", direction="LEFT") == [b"b", [b"6"]]
+ assert unstable_r.blmpop(1, "2", "foo", "bar", direction="RIGHT") is None
+
+ @pytest.mark.onlynoncluster
+ # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
def test_lmpop(self, unstable_r):
unstable_r.rpush("foo", "1", "2", "3", "4", "5")
result = [b"foo", [b"1", b"2"]]