MCPcopy
hub / github.com/redis/redis-py / test_xgroup_delconsumer

Method test_xgroup_delconsumer

tests/test_commands.py:6626–6641  ·  view source on GitHub ↗
(self, r)

Source from the content-addressed store, hash-verified

6624
6625 @skip_if_server_version_lt("5.0.0")
6626 def test_xgroup_delconsumer(self, r):
6627 stream = "stream"
6628 group = "group"
6629 consumer = "consumer"
6630 r.xadd(stream, {"foo": "bar"})
6631 r.xadd(stream, {"foo": "bar"})
6632 r.xgroup_create(stream, group, 0)
6633
6634 # a consumer that hasn't yet read any messages doesn't do anything
6635 assert r.xgroup_delconsumer(stream, group, consumer) == 0
6636
6637 # read all messages from the group
6638 r.xreadgroup(group, consumer, streams={stream: ">"})
6639
6640 # deleting the consumer should return 2 pending messages
6641 assert r.xgroup_delconsumer(stream, group, consumer) == 2
6642
6643 @skip_if_server_version_lt("6.2.0")
6644 def test_xgroup_createconsumer(self, r):

Callers

nothing calls this directly

Calls 4

xaddMethod · 0.80
xgroup_createMethod · 0.80
xgroup_delconsumerMethod · 0.80
xreadgroupMethod · 0.80

Tested by

no test coverage detected