Fix py26 compatibility issue, add mock to tox
This commit is contained in:
@@ -465,9 +465,8 @@ class TestKafkaClient(unittest.TestCase):
|
||||
return mocked_conns[(host, port)]
|
||||
|
||||
# patch to avoid making requests before we want it
|
||||
with patch.object(KafkaClient, 'load_metadata_for_topics'), \
|
||||
patch.object(KafkaClient, '_get_conn', side_effect=mock_get_conn):
|
||||
|
||||
with patch.object(KafkaClient, 'load_metadata_for_topics'):
|
||||
with patch.object(KafkaClient, '_get_conn', side_effect=mock_get_conn):
|
||||
client = KafkaClient(hosts=['kafka01:9092', 'kafka02:9092'])
|
||||
|
||||
self.assertRaises(
|
||||
@@ -495,9 +494,8 @@ class TestKafkaClient(unittest.TestCase):
|
||||
return mocked_conns[(host, port)]
|
||||
|
||||
# patch to avoid making requests before we want it
|
||||
with patch.object(KafkaClient, 'load_metadata_for_topics'), \
|
||||
patch.object(KafkaClient, '_get_conn', side_effect=mock_get_conn):
|
||||
|
||||
with patch.object(KafkaClient, 'load_metadata_for_topics'):
|
||||
with patch.object(KafkaClient, '_get_conn', side_effect=mock_get_conn):
|
||||
client = KafkaClient(hosts='kafka01:9092,kafka02:9092')
|
||||
|
||||
resp = client._send_broker_unaware_request(1, 'fake request')
|
||||
|
||||
Reference in New Issue
Block a user