'L{Request} objects that have registered pull producers get blocked and
unblocked according to HTTP/2 flow control.'

def test_handlesPullProducer(self):

    connection = H2Connection()
    connection.requestFactory = DummyPullProducerHandlerProxy
    (_, transport) = self.connectAndReceive(connection, self.getRequestHeaders, [])
    stream = connection.streams[1]
    request = stream._request.original
    producerComplete = request._actualProducer.result
    producerComplete.addCallback((lambda x: request.finish()))
    def validate(streamID):
        frames = framesFromBytes(transport.value())
        self.assertTrue(('END_STREAM' in frames[(-1)].flags))
        dataChunks = [f.data for f in frames if isinstance(f, hyperframe.frame.DataFrame)]
        self.assertEqual(dataChunks, ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ''])
    return connection._streamCleanupCallbacks[1].addCallback(validate)
