def _testDataForward(self, code, message, headers, body, method="GET",
                         requestBody="", loseConnection=True):
        request = self.makeRequest('foo')
        client = self.makeProxyClient(
            request, method, {'accept': 'text/html'}, requestBody)

        receivedBody = self.assertForwardsHeaders(
            client, '%s /foo HTTP/1.0' % (method,),
            {'connection': 'close', 'accept': 'text/html'})

        self.assertEquals(receivedBody, requestBody)

        # Fake an answer
        client.dataReceived(
            self.makeResponseBytes(code, message, headers, body))

        # Check that the response data has been forwarded back to the original
        # requester.
        self.assertForwardsResponse(request, code, message, headers, body)

        # Check that when the response is done, the request is finished.
        if loseConnection:
            client.transport.loseConnection()

        # Even if we didn't call loseConnection, the transport should be
        # disconnected.  This lets us not rely on the server to close our
        # sockets for us.
        self.assertFalse(client.transport.connected)
        self.assertEquals(request.finished, 1)
Build a fake proxy connection, and send C{data} over it, checking that
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/web/test/test_proxy.py/ProxyClientTestCase._testDataForward