(conn, method, url, *pos, **kw)
| 1392 | self.addCleanup(setattr, http.client, "HTTPConnection", real_class) |
| 1393 | urls = iter(("/path", "/path?query")) |
| 1394 | def request(conn, method, url, *pos, **kw): |
| 1395 | self.assertEqual(url, next(urls)) |
| 1396 | real_class.request(conn, method, url, *pos, **kw) |
| 1397 | # Change response for subsequent connection |
| 1398 | conn.__class__.fakedata = b"HTTP/1.1 200 OK\r\n\r\nHello!" |
| 1399 | http.client.HTTPConnection.request = request |
| 1400 | fp = urllib.request.urlopen("http://python.org/path") |
| 1401 | self.assertEqual(fp.geturl(), "http://python.org/path?query") |
no test coverage detected