summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorZack Dever <zdever@pandora.com>2016-03-17 12:17:03 -0700
committerZack Dever <zdever@pandora.com>2016-03-17 15:39:28 -0700
commit4915942b07236ca28731dab2fab80c0e93c14bf6 (patch)
treea6d3dcab6253e9eb2d43713eab0b10181659f0cd /test
parentab03296b65b2031930a0f04d06502b156dd01657 (diff)
downloadkafka-python-4915942b07236ca28731dab2fab80c0e93c14bf6.tar.gz
catch all errors thrown by _get_leader_for_partition in SimpleClient
Diffstat (limited to 'test')
-rw-r--r--test/test_client.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/test_client.py b/test/test_client.py
index 5a35c83..a53fce1 100644
--- a/test/test_client.py
+++ b/test/test_client.py
@@ -11,7 +11,7 @@ from kafka.common import (
BrokerMetadata,
TopicPartition, KafkaUnavailableError,
LeaderNotAvailableError, UnknownTopicOrPartitionError,
- KafkaTimeoutError, ConnectionError
+ KafkaTimeoutError, ConnectionError, FailedPayloadsError
)
from kafka.conn import KafkaConnection
from kafka.future import Future
@@ -361,7 +361,7 @@ class TestSimpleClient(unittest.TestCase):
"topic_noleader", 0,
[create_message("a"), create_message("b")])]
- with self.assertRaises(LeaderNotAvailableError):
+ with self.assertRaises(FailedPayloadsError):
client.send_produce_request(requests)
@patch('kafka.SimpleClient._get_conn')
@@ -386,7 +386,7 @@ class TestSimpleClient(unittest.TestCase):
"topic_doesnt_exist", 0,
[create_message("a"), create_message("b")])]
- with self.assertRaises(UnknownTopicOrPartitionError):
+ with self.assertRaises(FailedPayloadsError):
client.send_produce_request(requests)
def test_timeout(self):