def test_chat(self):
        factory = postfix.PostfixTCPMapDictServerFactory(self.data)
        transport = StringTransport()

        protocol = postfix.PostfixTCPMapServer()
        protocol.service = factory
        protocol.factory = factory
        protocol.makeConnection(transport)

        for input, expected_output in self.chat:
            protocol.lineReceived(input)
            self.assertEquals(
                transport.value(), expected_output,
                'For %r, expected %r but got %r' % (
                    input, expected_output, transport.value()))
            transport.clear()
        protocol.setTimeout(None)
Register a timer
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_postfix.py/PostfixTCPMapServerTestCase.test_chat--crossover with--dataset/ETHPy150Open pika/pika/pika/adapters/blocking_connection.py/_IoloopTimerContext.__enter__