Skip to content

Commit

Permalink
test: adapt publish test case
Browse files Browse the repository at this point in the history
  • Loading branch information
berrytern committed Sep 14, 2024
1 parent bd83e2f commit c112a61
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/unit/channels/test_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ async def test_async_publish_confirmation(
channel_factory_mock.create_channel.return_value = channel_mock
channel = AsyncChannel(channel_factory=channel_factory_mock)
channel.publisher_confirms = True
channel.futures = {}
channel.open(connection_mock)
publish = channel.publish(
exchange, routing_key, body, content_type, timeout, connection_mock.ioloop
Expand All @@ -64,5 +65,9 @@ async def test_async_publish_confirmation(
result = await publish
assert result is True
else:
channel._message_number += 1
channel.futures[channel._message_number] = future_publish
channel.ioloop.call_later = loop.call_later
channel.publish_confirmation = channel_mock.publish_confirmation
with pytest.raises(PublishTimeoutException):
await wait_for(publish, timeout=timeout + 1)

0 comments on commit c112a61

Please sign in to comment.