MCPcopy Index your code
hub / github.com/googlemaps/google-maps-services-python / test_custom_extract

Method test_custom_extract

tests/test_client.py:242–257  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

240
241 @responses.activate
242 def test_custom_extract(self):
243 def custom_extract(resp):
244 return resp.json()
245
246 responses.add(
247 responses.GET,
248 "https://maps.googleapis.com/bar",
249 body='{"error":"errormessage"}',
250 status=403,
251 content_type="application/json",
252 )
253
254 client = googlemaps.Client(key="AIzaasdf")
255 b = client._get("/bar", {}, extract_body=custom_extract)
256 self.assertEqual(1, len(responses.calls))
257 self.assertEqual("errormessage", b["error"])
258
259 @responses.activate
260 def test_retry_intermittent(self):

Callers

nothing calls this directly

Calls 1

_getMethod · 0.95

Tested by

no test coverage detected