diff options
| author | Dana Powers <dana.powers@rd.io> | 2015-12-16 22:38:54 -0800 |
|---|---|---|
| committer | Dana Powers <dana.powers@rd.io> | 2015-12-16 22:38:54 -0800 |
| commit | 7d4161f6d2b5302451f7dc2c139dbe1880635eb7 (patch) | |
| tree | 581d5a95aa361cd264b1acb69fecef69a4b4ebef /test/test_producer_integration.py | |
| parent | ba4ec47af00d4e45f9a48d36be16b20aece6556e (diff) | |
| download | kafka-python-7d4161f6d2b5302451f7dc2c139dbe1880635eb7.tar.gz | |
Add producer integration test for SimpleProducer handling new topic creation
Diffstat (limited to 'test/test_producer_integration.py')
| -rw-r--r-- | test/test_producer_integration.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/test/test_producer_integration.py b/test/test_producer_integration.py index 34963d3..e522e00 100644 --- a/test/test_producer_integration.py +++ b/test/test_producer_integration.py @@ -133,6 +133,12 @@ class TestKafkaProducerIntegration(KafkaIntegrationTestCase): # SimpleProducer Tests # ############################ + def test_simple_producer_new_topic(self): + producer = SimpleProducer(self.client) + resp = producer.send_messages('new_topic', self.msg('foobar')) + self.assert_produce_response(resp, 0) + producer.stop() + def test_simple_producer(self): partitions = self.client.get_partition_ids_for_topic(self.topic) start_offsets = [self.current_offset(self.topic, p) for p in partitions] @@ -157,15 +163,6 @@ class TestKafkaProducerIntegration(KafkaIntegrationTestCase): producer.stop() - def test_produce__new_topic_fails_with_reasonable_error(self): - new_topic = 'new_topic_{guid}'.format(guid = str(uuid.uuid4())).encode('utf-8') - producer = SimpleProducer(self.client, random_start=False) - - # At first it doesn't exist - with self.assertRaises((UnknownTopicOrPartitionError, - LeaderNotAvailableError)): - producer.send_messages(new_topic, self.msg("one")) - def test_producer_random_order(self): producer = SimpleProducer(self.client, random_start=True) resp1 = producer.send_messages(self.topic, self.msg("one"), self.msg("two")) |
