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

Method test_cookies

Lib/test/test_urllib2.py:1228–1243  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1226 self.assertEqual(o.args, (req, r, 502, "Bad gateway", {}))
1227
1228 def test_cookies(self):
1229 cj = MockCookieJar()
1230 h = urllib.request.HTTPCookieProcessor(cj)
1231 h.parent = MockOpener()
1232
1233 req = Request("http://example.com/")
1234 r = MockResponse(200, "OK", {}, "")
1235 newreq = h.http_request(req)
1236 self.assertIs(cj.ach_req, req)
1237 self.assertIs(cj.ach_req, newreq)
1238 self.assertEqual(req.origin_req_host, "example.com")
1239 self.assertFalse(req.unverifiable)
1240 newr = h.http_response(req, r)
1241 self.assertIs(cj.ec_req, req)
1242 self.assertIs(cj.ec_r, r)
1243 self.assertIs(r, newr)
1244
1245 def test_redirect(self):
1246 from_url = "http://example.com/a.html"

Callers

nothing calls this directly

Calls 9

http_requestMethod · 0.95
http_responseMethod · 0.95
RequestClass · 0.90
MockCookieJarClass · 0.85
MockOpenerClass · 0.85
MockResponseClass · 0.85
assertFalseMethod · 0.80
assertIsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected