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

Method test_request_path

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

Source from the content-addressed store, hash-verified

793 self.assertEqual(escape_path(arg), result)
794
795 def test_request_path(self):
796 # with parameters
797 req = urllib.request.Request(
798 "http://www.example.com/rheum/rhaponticum;"
799 "foo=bar;sing=song?apples=pears&spam=eggs#ni")
800 self.assertEqual(request_path(req),
801 "/rheum/rhaponticum;foo=bar;sing=song")
802 # without parameters
803 req = urllib.request.Request(
804 "http://www.example.com/rheum/rhaponticum?"
805 "apples=pears&spam=eggs#ni")
806 self.assertEqual(request_path(req), "/rheum/rhaponticum")
807 # missing final slash
808 req = urllib.request.Request("http://www.example.com")
809 self.assertEqual(request_path(req), "/")
810
811 def test_path_prefix_match(self):
812 pol = DefaultCookiePolicy()

Callers

nothing calls this directly

Calls 2

request_pathFunction · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected