Mock client.ensure_topic_exists in test_producer_sync_fail_on_error

This commit is contained in:
Dana Powers
2015-12-17 10:23:15 -08:00
parent 178a1dccd8
commit f89b9da1f3

View File

@@ -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]):