def test_pycurl_proxy(self):
"""If provided, the proxy is set in the request."""
curl = CurlStub(b"result")
proxy = "http://my.little.proxy"
result = fetch("http://example.com", curl=curl, proxy=proxy)
self.assertEqual(b"result", result)
self.assertEqual(proxy.encode('ascii'), curl.options[pycurl.PROXY])
评论列表
文章目录