'Check that L{ProxyRequest.process} correctly parse port in the incoming
URL, and create an outgoing connection with this port.'

def test_processWithPort(self):

    transport = StringTransportWithDisconnection()
    channel = DummyChannel(transport)
    reactor = MemoryReactor()
    request = ProxyRequest(channel, False, reactor)
    request.gotLength(0)
    request.requestReceived('GET', 'http://example.com:1234/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)
