Use the producer and collector properly
This commit is contained in:
parent
99a99a6122
commit
1a75b1e0b8
1 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@ async def test_producer_called(config, event_loop):
|
||||||
|
|
||||||
producer.producer = Mock()
|
producer.producer = Mock()
|
||||||
|
|
||||||
task = event_loop.create_task(producer.produce())
|
task = event_loop.create_task(producer())
|
||||||
await asyncio.sleep(0)
|
await asyncio.sleep(0)
|
||||||
producer.producer.send_and_wait.assert_called_with(
|
producer.producer.send_and_wait.assert_called_with(
|
||||||
config.kafka.topic, bytes(check.json().encode('utf-8')))
|
config.kafka.topic, bytes(check.json().encode('utf-8')))
|
||||||
|
@ -41,7 +41,7 @@ async def test_producer_called_invalid(config, event_loop):
|
||||||
|
|
||||||
producer.producer = Mock()
|
producer.producer = Mock()
|
||||||
|
|
||||||
task = event_loop.create_task(producer.produce())
|
task = event_loop.create_task(producer())
|
||||||
await asyncio.sleep(0)
|
await asyncio.sleep(0)
|
||||||
producer.logger.error.assert_called()
|
producer.logger.error.assert_called()
|
||||||
assert task.done()
|
assert task.done()
|
||||||
|
|
Loading…
Reference in a new issue