MCPcopy
hub / github.com/psf/requests / test_proxy_error_on_bad_url

Method test_proxy_error_on_bad_url

tests/test_requests.py:604–615  ·  view source on GitHub ↗
(self, httpbin, httpbin_secure)

Source from the content-addressed store, hash-verified

602 )
603
604 def test_proxy_error_on_bad_url(self, httpbin, httpbin_secure):
605 with pytest.raises(InvalidProxyURL):
606 requests.get(httpbin_secure(), proxies={"https": "http:/badproxyurl:3128"})
607
608 with pytest.raises(InvalidProxyURL):
609 requests.get(httpbin(), proxies={"http": "http://:8080"})
610
611 with pytest.raises(InvalidProxyURL):
612 requests.get(httpbin_secure(), proxies={"https": "https://"})
613
614 with pytest.raises(InvalidProxyURL):
615 requests.get(httpbin(), proxies={"http": "http:///example.com:8080"})
616
617 def test_respect_proxy_env_on_send_self_prepared_request(self, httpbin):
618 with override_environ(http_proxy=INVALID_PROXY):

Callers

nothing calls this directly

Calls 3

httpbin_secureFunction · 0.85
httpbinFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected