@responses.activate
def test_custom_extract(self):

    def custom_extract(resp):
        return resp.json()
    responses.add(responses.GET, 'https://maps.googleapis.com/bar', body='{"error":"errormessage"}', status=403, content_type='application/json')
    client = googlemaps.Client(key='AIzaasdf')
    b = client._get('/bar', {}, extract_body=custom_extract)
    self.assertEqual(1, len(responses.calls))
    self.assertEqual('errormessage', b['error'])
@responses.activate
def test_custom_extract(self):

    def custom_extract(resp):
        return resp.json()
    responses.add(responses.GET, 'https://maps.googleapis.com/bar', body='{"error":"errormessage"}', status=403, content_type='application/json')
    client = googlemaps.Client(key='AIzaasdf')
    b = client._get('/bar', {}, extract_body=custom_extract)
    self.assertEqual(1, len(responses.calls))
    self.assertEqual('errormessage', b['error'])