def _testProcess(self, uri, expectedURI, method=b"GET", data=b""):
        transport = StringTransportWithDisconnection()
        channel = DummyChannel(transport)
        reactor = MemoryReactor()
        request = ProxyRequest(channel, False, reactor)
        request.gotLength(len(data))
        request.handleContentChunk(data)
        request.requestReceived(method, b'http://example.com' + uri,
                                b'HTTP/1.0')

        self.assertEqual(len(reactor.tcpClients), 1)
        self.assertEqual(reactor.tcpClients[0][0], u"example.com")
        self.assertEqual(reactor.tcpClients[0][1], 80)

        factory = reactor.tcpClients[0][2]
        self.assertIsInstance(factory, ProxyClientFactory)
        self.assertEqual(factory.command, method)
        self.assertEqual(factory.version, b'HTTP/1.0')
        self.assertEqual(factory.headers, {b'host': b'example.com'})
        self.assertEqual(factory.data, data)
        self.assertEqual(factory.rest, expectedURI)
        self.assertEqual(factory.father, request)
Build a request pointing at C{uri}, and check that a proxied request
dataset/ETHPy150Open twisted/twisted/twisted/web/test/test_proxy.py/ProxyRequestTests._testProcess