'L{client.ProxyAgent} issues an HTTP request against the proxy, with the
full URI as path, when C{request} is called.'

def test_proxyRequest(self):

    headers = http_headers.Headers({'foo': ['bar']})
    body = object()
    self.agent.request('GET', 'http://example.com:1234/foo?bar', headers, body)
    (host, port, factory) = self.reactor.tcpClients.pop()[:3]
    self.assertEqual(host, 'bar')
    self.assertEqual(port, 5678)
    self.assertIsInstance(factory._wrappedFactory, client._HTTP11ClientFactory)
    protocol = self.protocol
    self.assertEqual(len(protocol.requests), 1)
    (req, res) = protocol.requests.pop()
    self.assertIsInstance(req, Request)
    self.assertEqual(req.method, 'GET')
    self.assertEqual(req.uri, 'http://example.com:1234/foo?bar')
    self.assertEqual(req.headers, http_headers.Headers({'foo': ['bar'], 'host': ['example.com:1234']}))
    self.assertIdentical(req.bodyProducer, body)
