diff options
author | Dana Powers <dana.powers@rd.io> | 2014-09-07 18:52:05 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@rd.io> | 2014-09-07 19:09:32 -0700 |
commit | 715425c639a476139065689afde3d255a07d6f96 (patch) | |
tree | 0ef2cd875c97c8ca867d89328d6fd5fec7dfcbe8 /test/test_conn.py | |
parent | a99384f4c601d127ab1c4fe5b272ea5c07fd695d (diff) | |
parent | be23042ecd9ab330886745ccc9ec9e3a0039836f (diff) | |
download | kafka-python-715425c639a476139065689afde3d255a07d6f96.tar.gz |
Merge pull request #227 from wizzat-feature/py3
Python 3 Support
Conflicts:
kafka/producer.py
test/test_client.py
test/test_client_integration.py
test/test_codec.py
test/test_consumer.py
test/test_consumer_integration.py
test/test_failover_integration.py
test/test_producer.py
test/test_producer_integration.py
test/test_protocol.py
test/test_util.py
Diffstat (limited to 'test/test_conn.py')
-rw-r--r-- | test/test_conn.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test_conn.py b/test/test_conn.py index 931ace7..7b3beb7 100644 --- a/test/test_conn.py +++ b/test/test_conn.py @@ -2,19 +2,19 @@ import socket import struct import mock -import unittest2 +from . import unittest from kafka.common import ConnectionError from kafka.conn import KafkaConnection, collect_hosts, DEFAULT_SOCKET_TIMEOUT_SECONDS -class ConnTest(unittest2.TestCase): +class ConnTest(unittest.TestCase): def setUp(self): self.config = { 'host': 'localhost', 'port': 9090, 'request_id': 0, - 'payload': 'test data', - 'payload2': 'another packet' + 'payload': b'test data', + 'payload2': b'another packet' } # Mocking socket.create_connection will cause _sock to always be a @@ -35,12 +35,12 @@ class ConnTest(unittest2.TestCase): struct.pack('>%ds' % payload_size, self.config['payload']), struct.pack('>i', payload2_size), struct.pack('>%ds' % payload2_size, self.config['payload2']), - '' + b'' ] # Create a connection object self.conn = KafkaConnection(self.config['host'], self.config['port']) - + # Reset any mock counts caused by __init__ self.MockCreateConn.reset_mock() |