'L{ReverseProxyRequest.process} should create a connection to its
factory host/port, using a L{ProxyClientFactory} instantiated with the
correct parameters, and particularly set the B{host} header to the
factory host.'

def test_process(self):

    transport = StringTransportWithDisconnection()
    channel = DummyChannel(transport)
    reactor = MemoryReactor()
    request = ReverseProxyRequest(channel, False, reactor)
    request.factory = DummyFactory(u'example.com', 1234)
    request.gotLength(0)
    request.requestReceived('GET', '/foo/bar', 'HTTP/1.0')
    self.assertEqual(len(reactor.tcpClients), 1)
    self.assertEqual(reactor.tcpClients[0][0], u'example.com')
    self.assertEqual(reactor.tcpClients[0][1], 1234)
    factory = reactor.tcpClients[0][2]
    self.assertIsInstance(factory, ProxyClientFactory)
    self.assertEqual(factory.headers, {'host': 'example.com'})
