From 35a14e18c631508e195f9377a6b5a4861966b3a2 Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Thu, 22 May 2014 12:06:38 -0700 Subject: Handle New Topic Creation Adds ensure_topic_exists to KafkaClient, redirects test case to use that. Fixes #113 and fixes #150. --- test/test_producer_integration.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/test_producer_integration.py') diff --git a/test/test_producer_integration.py b/test/test_producer_integration.py index c69e117..0718cb3 100644 --- a/test/test_producer_integration.py +++ b/test/test_producer_integration.py @@ -142,6 +142,15 @@ class TestKafkaProducerIntegration(KafkaIntegrationTestCase): producer.stop() + @kafka_versions("all") + def test_produce__new_topic_fails_with_reasonable_error(self): + new_topic = 'new_topic_{}'.format(str(uuid.uuid4())) + producer = SimpleProducer(self.client) + + # At first it doesn't exist + with self.assertRaises(UnknownTopicOrPartitionError): + resp = producer.send_messages(new_topic, self.msg("one")) + @kafka_versions("all") def test_producer_random_order(self): producer = SimpleProducer(self.client, random_start = True) -- cgit v1.2.1