def test_HTTPChannelToleratesPullProducers(self):
        """
        If the L{HTTPChannel} has a L{IPullProducer} registered with it it can
        adapt that producer into an L{IPushProducer}.
        """
        channel, transport = self.buildChannelAndTransport(
            StringTransport(), DummyPullProducerHandler
        )
        transport = StringTransport()
        channel = http.HTTPChannel()
        channel.requestFactory = DummyPullProducerHandlerProxy
        channel.makeConnection(transport)

        channel.dataReceived(self.request)
        request = channel.requests[0].original
        responseComplete = request._actualProducer.result

        def validate(ign):
            responseBody = transport.value().split(b'\r\n\r\n', 1)[1]
            expectedResponseBody = (
                b'1\r\n0\r\n'
                b'1\r\n1\r\n'
                b'1\r\n2\r\n'
                b'1\r\n3\r\n'
                b'1\r\n4\r\n'
                b'1\r\n5\r\n'
                b'1\r\n6\r\n'
                b'1\r\n7\r\n'
                b'1\r\n8\r\n'
                b'1\r\n9\r\n'
            )
            self.assertEqual(responseBody, expectedResponseBody)

        return responseComplete.addCallback(validate)

        If the L{HTTPChannel} has a L{IPullProducer} registered with it it can
        adapt that producer into an L{IPushProducer}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py