'L{H2Connection} correctly unblocks when a stream is ended.'

def test_lateCompletionWorks(self):

    connection = H2Connection()
    connection.requestFactory = DelayedHTTPHandlerProxy
    (_, transport) = self.connectAndReceive(connection, self.getRequestHeaders, [])
    request = connection.streams[1]._request.original
    reactor.callLater(0.01, request.finish)
    def validateComplete(*args):
        frames = framesFromBytes(transport.value())
        self.assertEqual(len(frames), 3)
        self.assertTrue(('END_STREAM' in frames[(-1)].flags))
    return connection._streamCleanupCallbacks[1].addCallback(validateComplete)
