

def test_protocolToConsumer(self):
    '\n        L{IProtocol} providers can be adapted to L{IConsumer} providers using\n        L{ProtocolToConsumerAdapter}.\n        '
    result = []
    p = Protocol()
    p.dataReceived = result.append
    consumer = IConsumer(p)
    consumer.write(b'hello')
    self.assertEqual(result, [b'hello'])
    self.assertIsInstance(self, ProtocolToConsumerAdapter)

dataset/ETHPy150Open twisted/twisted/twisted/internet/test/test_protocol.py AdapterTests.test_protocolToConsumer/VarMisuse@60/117 `consumer`->`self`