Fix test_consumer generator/list mock, reenable tests
This commit is contained in:
@@ -30,7 +30,6 @@ class TestMultiProcessConsumer(unittest.TestCase):
|
|||||||
self.assertEqual(client.get_partition_ids_for_topic.call_count, 0) # pylint: disable=no-member
|
self.assertEqual(client.get_partition_ids_for_topic.call_count, 0) # pylint: disable=no-member
|
||||||
|
|
||||||
class TestSimpleConsumer(unittest.TestCase):
|
class TestSimpleConsumer(unittest.TestCase):
|
||||||
@unittest.skip
|
|
||||||
def test_simple_consumer_failed_payloads(self):
|
def test_simple_consumer_failed_payloads(self):
|
||||||
client = MagicMock()
|
client = MagicMock()
|
||||||
consumer = SimpleConsumer(client, group=None,
|
consumer = SimpleConsumer(client, group=None,
|
||||||
@@ -45,7 +44,6 @@ class TestSimpleConsumer(unittest.TestCase):
|
|||||||
# This should not raise an exception
|
# This should not raise an exception
|
||||||
consumer.get_messages(5)
|
consumer.get_messages(5)
|
||||||
|
|
||||||
@unittest.skip
|
|
||||||
def test_simple_consumer_leader_change(self):
|
def test_simple_consumer_leader_change(self):
|
||||||
client = MagicMock()
|
client = MagicMock()
|
||||||
consumer = SimpleConsumer(client, group=None,
|
consumer = SimpleConsumer(client, group=None,
|
||||||
@@ -66,7 +64,6 @@ class TestSimpleConsumer(unittest.TestCase):
|
|||||||
self.assertGreaterEqual(client.reset_topic_metadata.call_count, 1)
|
self.assertGreaterEqual(client.reset_topic_metadata.call_count, 1)
|
||||||
self.assertGreaterEqual(client.load_metadata_for_topics.call_count, 1)
|
self.assertGreaterEqual(client.load_metadata_for_topics.call_count, 1)
|
||||||
|
|
||||||
@unittest.skip
|
|
||||||
def test_simple_consumer_unknown_topic_partition(self):
|
def test_simple_consumer_unknown_topic_partition(self):
|
||||||
client = MagicMock()
|
client = MagicMock()
|
||||||
consumer = SimpleConsumer(client, group=None,
|
consumer = SimpleConsumer(client, group=None,
|
||||||
@@ -129,10 +126,10 @@ class TestSimpleConsumer(unittest.TestCase):
|
|||||||
def fail_requests(payloads, **kwargs):
|
def fail_requests(payloads, **kwargs):
|
||||||
responses = [
|
responses = [
|
||||||
FetchResponsePayload(payloads[0].topic, payloads[0].partition, 0, 0,
|
FetchResponsePayload(payloads[0].topic, payloads[0].partition, 0, 0,
|
||||||
(OffsetAndMessage(
|
[OffsetAndMessage(
|
||||||
payloads[0].offset + i,
|
payloads[0].offset + i,
|
||||||
"msg %d" % (payloads[0].offset + i))
|
"msg %d" % (payloads[0].offset + i))
|
||||||
for i in range(10))),
|
for i in range(10)]),
|
||||||
]
|
]
|
||||||
for failure in payloads[1:]:
|
for failure in payloads[1:]:
|
||||||
responses.append(error_factory(failure))
|
responses.append(error_factory(failure))
|
||||||
|
|||||||
Reference in New Issue
Block a user