diff options
author | Dana Powers <dana.powers@rd.io> | 2016-01-07 18:51:14 -0800 |
---|---|---|
committer | Dana Powers <dana.powers@rd.io> | 2016-01-07 18:51:14 -0800 |
commit | 828377377da43749af0d27ee256ef31bf714cf17 (patch) | |
tree | fbad4d4381fc4d1ea2be7ce2009214d18fbeb674 /test/testutil.py | |
parent | 71e7568fcb8132899f366b37c32645fd5a40dc4b (diff) | |
parent | 9a8af1499ca425366d934487469d9977fae7fe5f (diff) | |
download | kafka-python-828377377da43749af0d27ee256ef31bf714cf17.tar.gz |
Merge branch '0.9'
Conflicts:
kafka/codec.py
kafka/version.py
test/test_producer.py
test/test_producer_integration.py
Diffstat (limited to 'test/testutil.py')
-rw-r--r-- | test/testutil.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/test/testutil.py b/test/testutil.py index fc3ebfa..4881a32 100644 --- a/test/testutil.py +++ b/test/testutil.py @@ -11,9 +11,8 @@ import uuid from six.moves import xrange from . import unittest -from kafka import KafkaClient -from kafka.common import OffsetRequest -from kafka.util import kafka_bytestring +from kafka import SimpleClient +from kafka.common import OffsetRequestPayload __all__ = [ 'random_string', @@ -84,7 +83,6 @@ def get_open_port(): class KafkaIntegrationTestCase(unittest.TestCase): create_client = True topic = None - bytes_topic = None zk = None server = None @@ -96,10 +94,9 @@ class KafkaIntegrationTestCase(unittest.TestCase): if not self.topic: topic = "%s-%s" % (self.id()[self.id().rindex(".") + 1:], random_string(10)) self.topic = topic - self.bytes_topic = topic.encode('utf-8') if self.create_client: - self.client = KafkaClient('%s:%d' % (self.server.host, self.server.port)) + self.client = SimpleClient('%s:%d' % (self.server.host, self.server.port)) self.client.ensure_topic_exists(self.topic) @@ -115,7 +112,7 @@ class KafkaIntegrationTestCase(unittest.TestCase): def current_offset(self, topic, partition): try: - offsets, = self.client.send_offset_request([ OffsetRequest(kafka_bytestring(topic), partition, -1, 1) ]) + offsets, = self.client.send_offset_request([OffsetRequestPayload(topic, partition, -1, 1)]) except: # XXX: We've seen some UnknownErrors here and cant debug w/o server logs self.zk.child.dump_logs() @@ -149,6 +146,3 @@ class Timer(object): logging.basicConfig(level=logging.DEBUG) logging.getLogger('test.fixtures').setLevel(logging.ERROR) logging.getLogger('test.service').setLevel(logging.ERROR) - -# kafka.conn debug logging is verbose, disable in tests by default -logging.getLogger('kafka.conn').setLevel(logging.INFO) |