(self)
| 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" |
nothing calls this directly
no test coverage detected