def _testRender(self, uri, expectedURI):
        root = Resource()
        reactor = MemoryReactor()
        resource = ReverseProxyResource(u"127.0.0.1", 1234, b"/path", reactor)
        root.putChild(b'index', resource)
        site = Site(root)

        transport = StringTransportWithDisconnection()
        channel = site.buildProtocol(None)
        channel.makeConnection(transport)
        # Clear the timeout if the tests failed
        self.addCleanup(channel.connectionLost, None)

        channel.dataReceived(b"GET " +
                             uri +
                             b" HTTP/1.1\r\nAccept: text/html\r\n\r\n")

        # Check that one connection has been created, to the good host/port
        self.assertEqual(len(reactor.tcpClients), 1)
        self.assertEqual(reactor.tcpClients[0][0], u"127.0.0.1")
        self.assertEqual(reactor.tcpClients[0][1], 1234)

        # Check the factory passed to the connect, and its given path
        factory = reactor.tcpClients[0][2]
        self.assertIsInstance(factory, ProxyClientFactory)
        self.assertEqual(factory.rest, expectedURI)
        self.assertEqual(factory.headers[b"host"], b"127.0.0.1:1234")
gets all the non-raw, non-composite ancestors of a building
dataset/ETHPy150Open twisted/twisted/twisted/web/test/test_proxy.py/ReverseProxyResourceTests._testRender--crossover with--dataset/ETHPy150Open buildingenergy/buildingenergy-platform/seed/models.py/get_ancestors