def test_consumerToProtocol(self):
        result = []
        @implementer(IConsumer)
        class Consumer(object):
            def write(self, d):
                result.append(d)

        c = Consumer()
        protocol = IProtocol(c)
        protocol.dataReceived(b"hello")
        self.assertEqual(result, [b"hello"])
        self.assertIsInstance(protocol, ConsumerToProtocolAdapter)
Obtain an editing lock on this dataset.
dataset/ETHPy150Open twisted/twisted/twisted/internet/test/test_protocol.py/AdapterTests.test_consumerToProtocol--crossover with--dataset/ETHPy150Open pandaproject/panda/panda/models/dataset.py/Dataset.lock