summaryrefslogtreecommitdiff
path: root/test/test_client.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@rd.io>2015-12-21 01:37:25 -0800
committerDana Powers <dana.powers@rd.io>2015-12-28 13:44:29 -0800
commitc9e6f17e42e410adfe583d987c516149bdcdcdae (patch)
tree9ec12383f55c9dcd001516f6982e4437af4de408 /test/test_client.py
parentfd1801907f85ac7686b9452c08ae908c3a88cd51 (diff)
downloadkafka-python-c9e6f17e42e410adfe583d987c516149bdcdcdae.tar.gz
Rename TopicAndPartition -> TopicPartition
Diffstat (limited to 'test/test_client.py')
-rw-r--r--test/test_client.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/test_client.py b/test/test_client.py
index 00e888c..8c62eb9 100644
--- a/test/test_client.py
+++ b/test/test_client.py
@@ -9,7 +9,7 @@ from kafka import KafkaClient
from kafka.common import (
ProduceRequestPayload,
BrokerMetadata,
- TopicAndPartition, KafkaUnavailableError,
+ TopicPartition, KafkaUnavailableError,
LeaderNotAvailableError, UnknownTopicOrPartitionError,
KafkaTimeoutError, ConnectionError
)
@@ -145,12 +145,12 @@ class TestKafkaClient(unittest.TestCase):
# client loads metadata at init
client = KafkaClient(hosts=['broker_1:4567'])
self.assertDictEqual({
- TopicAndPartition('topic_1', 0): brokers[1],
- TopicAndPartition('topic_noleader', 0): None,
- TopicAndPartition('topic_noleader', 1): None,
- TopicAndPartition('topic_3', 0): brokers[0],
- TopicAndPartition('topic_3', 1): brokers[1],
- TopicAndPartition('topic_3', 2): brokers[0]},
+ TopicPartition('topic_1', 0): brokers[1],
+ TopicPartition('topic_noleader', 0): None,
+ TopicPartition('topic_noleader', 1): None,
+ TopicPartition('topic_3', 0): brokers[0],
+ TopicPartition('topic_3', 1): brokers[1],
+ TopicPartition('topic_3', 2): brokers[0]},
client.topics_to_brokers)
# if we ask for metadata explicitly, it should raise errors
@@ -260,7 +260,7 @@ class TestKafkaClient(unittest.TestCase):
self.assertEqual(brokers[0], leader)
self.assertDictEqual({
- TopicAndPartition('topic_one_partition', 0): brokers[0]},
+ TopicPartition('topic_one_partition', 0): brokers[0]},
client.topics_to_brokers)
@patch('kafka.client.KafkaClient._get_conn')
@@ -312,8 +312,8 @@ class TestKafkaClient(unittest.TestCase):
client = KafkaClient(hosts=['broker_1:4567'])
self.assertDictEqual(
{
- TopicAndPartition('topic_noleader', 0): None,
- TopicAndPartition('topic_noleader', 1): None
+ TopicPartition('topic_noleader', 0): None,
+ TopicPartition('topic_noleader', 1): None
},
client.topics_to_brokers)