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