Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 5 additions & 24 deletions tests/unit/transport/test_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,43 +196,24 @@ async def test_on_rebalance(self, *, manager):

await manager.on_rebalance(set(), set(), set())

@pytest.mark.skip("Needs fixing")
@pytest.mark.asyncio
async def test__stop_transactions(self, *, manager, producer):
tids = ["0-0", "1-0"]
manager._start_new_producer = AsyncMock()
await manager._stop_transactions(tids)
producer.stop_transaction.assert_called()
producer.stop_transaction.assert_called_once_with(
[
# The problem is that some reason calls with extra
# (commented out) garbage are being included
# call.shortlabel.__bool__(),
# call.shortlabel._str__(),
call("0-0"),
# call.shortlabel.__bool__(),
# call.shortlabel._str__(),
call("1-0"),
]
assert producer.stop_transaction.call_count == 2
producer.stop_transaction.assert_has_calls(
[call("0-0"), call("1-0")], any_order=True
)

@pytest.mark.skip("Needs fixing")
@pytest.mark.asyncio
async def test_start_transactions(self, *, manager, producer):
tids = ["0-0", "1-0"]
manager._start_new_producer = AsyncMock()
await manager._start_transactions(tids)
assert producer.maybe_begin_transaction.call_count == 2
producer.maybe_begin_transaction.assert_has_calls(
[
# The problem is that some reason calls with extra
# (commented out) garbage are being included
# call.shortlabel.__bool__(),
# call.shortlabel._str__(),
call("0-0"),
# call.shortlabel.__bool__(),
# call.shortlabel._str__(),
call("1-0"),
]
[call("0-0"), call("1-0")], any_order=True
)

@pytest.mark.asyncio
Expand Down
Loading