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

Method test_execute

tests/test_http.py:1331–1352  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1329 self.assertEqual(None, ret)
1330
1331 def test_execute(self):
1332 batch = BatchHttpRequest()
1333 callbacks = Callbacks()
1334
1335 batch.add(self.request1, callback=callbacks.f)
1336 batch.add(self.request2, callback=callbacks.f)
1337 http = HttpMockSequence(
1338 [
1339 (
1340 {
1341 "status": "200",
1342 "content-type": 'multipart/mixed; boundary="batch_foobarbaz"',
1343 },
1344 BATCH_RESPONSE,
1345 )
1346 ]
1347 )
1348 batch.execute(http=http)
1349 self.assertEqual({"foo": 42}, callbacks.responses["1"])
1350 self.assertEqual(None, callbacks.exceptions["1"])
1351 self.assertEqual({"baz": "qux"}, callbacks.responses["2"])
1352 self.assertEqual(None, callbacks.exceptions["2"])
1353
1354 def test_execute_request_body(self):
1355 batch = BatchHttpRequest()

Callers

nothing calls this directly

Calls 5

addMethod · 0.95
executeMethod · 0.95
BatchHttpRequestClass · 0.90
HttpMockSequenceClass · 0.90
CallbacksClass · 0.85

Tested by

no test coverage detected