@responses.activate
def test_retry(self):

    class request_callback():

        def __init__(self):
            self.first_req = True

        def __call__(self, req):
            if self.first_req:
                self.first_req = False
                return (200, {}, '{"status":"OVER_QUERY_LIMIT"}')
            return (200, {}, '{"status":"OK","results":[]}')
    responses.add_callback(responses.GET, 'https://maps.googleapis.com/maps/api/geocode/json', content_type='application/json', callback=request_callback())
    client = googlemaps.Client(key='AIzaasdf')
    client.geocode('Sesame St.')
    self.assertEqual(2, len(responses.calls))
    self.assertEqual(responses.calls[0].request.url, responses.calls[1].request.url)
@responses.activate
def test_retry(self):

    class request_callback():

        def __init__(self):
            self.first_req = True

        def __call__(self, req):
            if self.first_req:
                self.first_req = False
                return (200, {}, '{"status":"OVER_QUERY_LIMIT"}')
            return (200, {}, '{"status":"OK","results":[]}')
    responses.add_callback(responses.GET, 'https://maps.googleapis.com/maps/api/geocode/json', content_type='application/json', callback=request_callback())
    client = googlemaps.Client(key='AIzaasdf')
    client.geocode('Sesame St.')
    self.assertEqual(2, len(responses.calls))
    self.assertEqual(responses.calls[0].request.url, responses.calls[1].request.url)