summaryrefslogtreecommitdiff
path: root/tests/test_commands.py
diff options
context:
space:
mode:
authorAvital Fine <79420960+AvitalFineRedis@users.noreply.github.com>2021-08-30 09:34:23 +0300
committerGitHub <noreply@github.com>2021-08-30 09:34:23 +0300
commitefdba1a77a2755c70ba9754aa592dde8c8c50217 (patch)
tree4233c037d0d1c2a2bac69a1648dc04b7f3f12f12 /tests/test_commands.py
parent41e3f56f65b690ae39ab798a85b42e44ee72a829 (diff)
downloadredis-py-efdba1a77a2755c70ba9754aa592dde8c8c50217.tar.gz
xgroup_createconsumer (#1553)
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r--tests/test_commands.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py
index 0e71fcf..0c9ca1e 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -2731,6 +2731,22 @@ class TestRedisCommands:
# deleting the consumer should return 2 pending messages
assert r.xgroup_delconsumer(stream, group, consumer) == 2
+ @skip_if_server_version_lt('6.2.0')
+ def test_xgroup_createconsumer(self, r):
+ stream = 'stream'
+ group = 'group'
+ consumer = 'consumer'
+ r.xadd(stream, {'foo': 'bar'})
+ r.xadd(stream, {'foo': 'bar'})
+ r.xgroup_create(stream, group, 0)
+ assert r.xgroup_createconsumer(stream, group, consumer) == 1
+
+ # read all messages from the group
+ r.xreadgroup(group, consumer, streams={stream: '>'})
+
+ # deleting the consumer should return 2 pending messages
+ assert r.xgroup_delconsumer(stream, group, consumer) == 2
+
@skip_if_server_version_lt('5.0.0')
def test_xgroup_destroy(self, r):
stream = 'stream'