def test_handle_requeue(self):
"""
Given that I have a channel
When I receive a requeue on that channel
I should ask the the consumer to requeue the message
"""
body = BrightsideMessageBody("test message")
header = BrightsideMessageHeader(uuid4(), "test topic", BrightsideMessageType.MT_COMMAND)
message = BrightsideMessage(header, body)
fake_queue = []
consumer = FakeConsumer(fake_queue)
channel = Channel("test", consumer, Pipeline())
channel.requeue(message)
self.assertEqual(len(consumer), 1)
评论列表
文章目录