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

Method request

Lib/test/test_urllib2.py:1394–1398  ·  view source on GitHub ↗
(conn, method, url, *pos, **kw)

Source from the content-addressed store, hash-verified

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")

Callers 15

make_request_and_skipFunction · 0.45
test_get_cssMethod · 0.45
test_lambdaMethod · 0.45
test_autolinkingMethod · 0.45
test_system_methodsMethod · 0.45
test_annotationsMethod · 0.45
test_404Method · 0.45
test_reuse_reconnectMethod · 0.45

Calls 1

assertEqualMethod · 0.45

Tested by

no test coverage detected