Mock client.ensure_topic_exists in test_producer_sync_fail_on_error
This commit is contained in:
@@ -97,6 +97,7 @@ class TestKafkaProducer(unittest.TestCase):
|
|||||||
def test_producer_sync_fail_on_error(self):
|
def test_producer_sync_fail_on_error(self):
|
||||||
error = FailedPayloadsError('failure')
|
error = FailedPayloadsError('failure')
|
||||||
with patch.object(KafkaClient, 'load_metadata_for_topics'):
|
with patch.object(KafkaClient, 'load_metadata_for_topics'):
|
||||||
|
with patch.object(KafkaClient, 'ensure_topic_exists'):
|
||||||
with patch.object(KafkaClient, 'get_partition_ids_for_topic', return_value=[0, 1]):
|
with patch.object(KafkaClient, 'get_partition_ids_for_topic', return_value=[0, 1]):
|
||||||
with patch.object(KafkaClient, '_send_broker_aware_request', return_value = [error]):
|
with patch.object(KafkaClient, '_send_broker_aware_request', return_value = [error]):
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user