Beispiel #1
0
 async def test__commit__CommitFailedError(self, *, cthread, _consumer):
     cthread._consumer = _consumer
     exc = _consumer.commit.side_effect = CommitFailedError('xx')
     cthread.crash = AsyncMock()
     assert not (await cthread._commit({TP1: 1001}))
     cthread.crash.assert_called_once_with(exc)
Beispiel #2
0
 async def test__commit__already_rebalancing(self, *, cthread, _consumer):
     cthread._consumer = _consumer
     _consumer.commit.side_effect = CommitFailedError('already rebalanced')
     assert not (await cthread._commit({TP1: 1001}))