MCPcopy Index your code
hub / github.com/python/cpython / test_request_port

Method test_request_port

Lib/test/test_http_cookiejar.py:835–841  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

833 self.assertFalse(strict_ns_path_pol.set_ok_path(cookie, req))
834
835 def test_request_port(self):
836 req = urllib.request.Request("http://www.acme.com:1234/",
837 headers={"Host": "www.acme.com:4321"})
838 self.assertEqual(request_port(req), "1234")
839 req = urllib.request.Request("http://www.acme.com/",
840 headers={"Host": "www.acme.com:4321"})
841 self.assertEqual(request_port(req), DEFAULT_HTTP_PORT)
842
843 def test_request_host(self):
844 # this request is illegal (RFC2616, 14.2.3)

Callers

nothing calls this directly

Calls 2

request_portFunction · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected