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

Class MockOpener

Lib/test/test_urllib2.py:274–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272
273
274class MockOpener:
275 addheaders = []
276
277 def open(self, req, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
278 self.req, self.data, self.timeout = req, data, timeout
279
280 def error(self, proto, *args):
281 self.proto, self.args = proto, args
282
283
284class MockFile:

Callers 15

test_ftpMethod · 0.85
test_fileMethod · 0.85
test_httpMethod · 0.85
test_http_body_fileMethod · 0.85
test_http_body_pipeMethod · 0.85
test_http_body_arrayMethod · 0.85
test_http_doubleslashMethod · 0.85
test_errorsMethod · 0.85

Calls

no outgoing calls

Tested by 15

test_ftpMethod · 0.68
test_fileMethod · 0.68
test_httpMethod · 0.68
test_http_body_fileMethod · 0.68
test_http_body_pipeMethod · 0.68
test_http_body_arrayMethod · 0.68
test_http_doubleslashMethod · 0.68
test_errorsMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…