diff options
author | Dana Powers <dana.powers@rd.io> | 2014-08-13 11:51:48 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@rd.io> | 2014-08-14 09:26:16 -0700 |
commit | 18fdddf37f552cef72bd7714c1aacc8a35a5f190 (patch) | |
tree | 64a195c9f959a5203246be1c7562beaeb16646d1 /test/test_client_integration.py | |
parent | 5a02d6393d573ca8512a7032a35391bc5ac96f6b (diff) | |
download | kafka-python-18fdddf37f552cef72bd7714c1aacc8a35a5f190.tar.gz |
Add KafkaTimeoutError (used by client.ensure_topic_exists) and add a test
Diffstat (limited to 'test/test_client_integration.py')
-rw-r--r-- | test/test_client_integration.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_client_integration.py b/test/test_client_integration.py index 49c4b57..98f2473 100644 --- a/test/test_client_integration.py +++ b/test/test_client_integration.py @@ -49,6 +49,17 @@ class TestKafkaClientIntegration(KafkaIntegrationTestCase): messages = list(fetch_resp.messages) self.assertEquals(len(messages), 0) + @kafka_versions("all") + def test_ensure_topic_exists(self): + + # assume that self.topic was created by setUp + # if so, this should succeed + self.client.ensure_topic_exists(self.topic, timeout=1) + + # ensure_topic_exists should fail with KafkaTimeoutError + with self.assertRaises(KafkaTimeoutError): + self.client.ensure_topic_exists("this_topic_doesnt_exist", timeout=0) + #################### # Offset Tests # #################### |