'Check that a request pointing at C{uri} produce a new proxy connection,
with the path of this request pointing at C{expectedURI}.'

def _testRender(self, uri, expectedURI):

    root = Resource()
    reactor = MemoryReactor()
    resource = ReverseProxyResource(u'127.0.0.1', 1234, '/path', reactor)
    root.putChild('index', resource)
    site = Site(root)
    transport = StringTransportWithDisconnection()
    channel = site.buildProtocol(None)
    channel.makeConnection(transport)
    self.addCleanup(channel.connectionLost, None)
    channel.dataReceived((('GET    ' + uri) + '    HTTP/1.1\r\nAccept:    text/html\r\n\r\n'))
    self.assertEqual(len(reactor.tcpClients), 1)
    self.assertEqual(reactor.tcpClients[0][0], u'127.0.0.1')
    self.assertEqual(reactor.tcpClients[0][1], 1234)
    factory = reactor.tcpClients[0][2]
    self.assertIsInstance(factory, ProxyClientFactory)
    self.assertEqual(factory.rest, expectedURI)
    self.assertEqual(factory.headers['host'], '127.0.0.1:1234')
