MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_cookies

Method test_cookies

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

Source from the content-addressed store, hash-verified

1209 self.assertEqual(o.args, (req, r, 502, "Bad gateway", {}))
1210
1211 def test_cookies(self):
1212 cj = MockCookieJar()
1213 h = urllib.request.HTTPCookieProcessor(cj)
1214 h.parent = MockOpener()
1215
1216 req = Request("http://example.com/")
1217 r = MockResponse(200, "OK", {}, "")
1218 newreq = h.http_request(req)
1219 self.assertIs(cj.ach_req, req)
1220 self.assertIs(cj.ach_req, newreq)
1221 self.assertEqual(req.origin_req_host, "example.com")
1222 self.assertFalse(req.unverifiable)
1223 newr = h.http_response(req, r)
1224 self.assertIs(cj.ec_req, req)
1225 self.assertIs(cj.ec_r, r)
1226 self.assertIs(r, newr)
1227
1228 def test_redirect(self):
1229 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