'Send a POST request without length and confirm that the data is safely
transferred.'

def test_postRequestNoLength(self):

    postResponseHeaders = [(':status', '200'), ('request', '/post_endpoint'), ('command', 'POST'), ('version', 'HTTP/2'), ('content-length', '38')]
    postResponseData = "'''\nNone\nhello    world,    it's    http/2!'''\n"
    postRequestHeaders = [(x, y) for (x, y) in self.postRequestHeaders if (x != 'content-length')]
    connection = H2Connection()
    connection.requestFactory = DummyHTTPHandlerProxy
    (_, transport) = self.connectAndReceive(connection, postRequestHeaders, self.postRequestData)
    def validate(streamID):
        frames = framesFromBytes(transport.value())
        self.assertEqual(len(frames), 4)
        self.assertTrue(all(((f.stream_id == 1) for f in frames[(-3):])))
        self.assertTrue(isinstance(frames[(-3)], hyperframe.frame.HeadersFrame))
        self.assertTrue(isinstance(frames[(-2)], hyperframe.frame.DataFrame))
        self.assertTrue(isinstance(frames[(-1)], hyperframe.frame.DataFrame))
        self.assertEqual(dict(frames[(-3)].data), dict(postResponseHeaders))
        self.assertEqual(frames[(-2)].data, postResponseData)
        self.assertEqual(frames[(-1)].data, '')
        self.assertTrue(('END_STREAM' in frames[(-1)].flags))
    return connection._streamCleanupCallbacks[1].addCallback(validate)
