'Many interleaved POST requests all get received and responded to
appropriately.'

def test_interleavedRequests(self):

    REQUEST_COUNT = 40
    f = FrameFactory()
    b = StringTransport()
    a = H2Connection()
    a.requestFactory = DummyHTTPHandlerProxy
    streamIDs = list(range(1, (REQUEST_COUNT * 2), 2))
    frames = [buildRequestFrames(self.postRequestHeaders, self.postRequestData, f, streamID) for streamID in streamIDs]
    requestBytes = f.clientConnectionPreface()
    frames = itertools.chain.from_iterable(zip(*frames))
    requestBytes += ''.join((frame.serialize() for frame in frames))
    a.makeConnection(b)
    for byte in iterbytes(requestBytes):
        a.dataReceived(byte)
    def validate(results):
        frames = framesFromBytes(b.value())
        self.assertEqual(len(frames), (1 + (3 * 40)))
        for streamID in streamIDs:
            streamFrames = [f for f in frames if ((f.stream_id == streamID) and (not isinstance(f, hyperframe.frame.WindowUpdateFrame)))]
            self.assertEqual(len(streamFrames), 3)
            self.assertEqual(dict(streamFrames[0].data), dict(self.postResponseHeaders))
            self.assertEqual(streamFrames[1].data, self.postResponseData)
            self.assertEqual(streamFrames[2].data, '')
            self.assertTrue(('END_STREAM' in streamFrames[2].flags))
    return defer.DeferredList(list(a._streamCleanupCallbacks.values())).addCallback(validate)
