(conn, method, url, *pos, **kw)
| 1375 | self.addCleanup(setattr, http.client, "HTTPConnection", real_class) |
| 1376 | urls = iter(("/path", "/path?query")) |
| 1377 | def request(conn, method, url, *pos, **kw): |
| 1378 | self.assertEqual(url, next(urls)) |
| 1379 | real_class.request(conn, method, url, *pos, **kw) |
| 1380 | # Change response for subsequent connection |
| 1381 | conn.__class__.fakedata = b"HTTP/1.1 200 OK\r\n\r\nHello!" |
| 1382 | http.client.HTTPConnection.request = request |
| 1383 | fp = urllib.request.urlopen("http://python.org/path") |
| 1384 | self.assertEqual(fp.geturl(), "http://python.org/path?query") |
no test coverage detected