def test_kafka_consumer(self):
        self.send_messages(0, range(0, 100))
        self.send_messages(1, range(100, 200))

        # Start a consumer
        consumer = self.kafka_consumer(auto_offset_reset='earliest')
        n = 0
        messages = {0: set(), 1: set()}
        for m in consumer:
            logging.debug("Consumed message %s" % repr(m))
            n += 1
            messages[m.partition].add(m.offset)
            if n >= 200:
                break

        self.assertEqual(len(messages[0]), 100)
        self.assertEqual(len(messages[1]), 100)
dataset/ETHPy150Open dpkp/kafka-python/test/test_consumer_integration.py/TestConsumerIntegration.test_kafka_consumer/original