MCPcopy Index your code
hub / github.com/googleapis/google-api-python-client / request

Method request

tests/test_http.py:129–152  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

127 self.success_data = success_data
128
129 def request(self, *args, **kwargs):
130 if not self.num_errors:
131 return httplib2.Response(self.success_json), self.success_data
132 elif self.num_errors == 5:
133 ex = ConnectionResetError # noqa: F821
134 elif self.num_errors == 4:
135 ex = httplib2.ServerNotFoundError()
136 elif self.num_errors == 3:
137 ex = OSError()
138 ex.errno = socket.errno.EPIPE
139 elif self.num_errors == 2:
140 ex = ssl.SSLError()
141 else:
142 # Initialize the timeout error code to the platform's error code.
143 try:
144 # For Windows:
145 ex = OSError()
146 ex.errno = socket.errno.WSAETIMEDOUT
147 except AttributeError:
148 # For Linux/Mac:
149 ex = socket.timeout()
150
151 self.num_errors -= 1
152 raise ex
153
154
155class HttpMockWithNonRetriableErrors(object):

Callers 11

test_json_no_bodyMethod · 0.45
test_json_bodyMethod · 0.45
test_json_build_queryMethod · 0.45
test_user_agentMethod · 0.45
test_loggingMethod · 0.45
test_no_bodyMethod · 0.45
test_bodyMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected