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

Method request

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

Source from the content-addressed store, hash-verified

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

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 2

nextFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected