From 61c8dff52e5c78b9d397cc5dfd4d590ae719a5a3 Mon Sep 17 00:00:00 2001 From: Dave Holmes Date: Wed, 1 Oct 2014 16:49:20 +1000 Subject: [PATCH] Updating the API Keys to use a boilerplate --- samples.py | 2 +- test/test_common.py | 10 +++++----- test/test_directions.py | 2 +- test/test_distance_matrix.py | 2 +- test/test_elevation.py | 2 +- test/test_geocoding.py | 2 +- test/test_timezone.py | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/samples.py b/samples.py index bc351540..976c71d7 100644 --- a/samples.py +++ b/samples.py @@ -22,7 +22,7 @@ def main(): c = googlemaps.Context( - key="AIzaSyDyZdCabN8GKh786tdj16gq80xalbbfqDM", + key="YOUR-API-KEY-HERE", timeout=5) locations = [(40.714728, -73.998672), (-34.397, 150.644)] diff --git a/test/test_common.py b/test/test_common.py index a5860289..1362464c 100644 --- a/test/test_common.py +++ b/test/test_common.py @@ -48,13 +48,13 @@ def test_key_sent(self): status=200, content_type='application/json') - ctx = googlemaps.Context(key="AIzaasdf") + ctx = googlemaps.Context(key="YOUR-API-KEY-HERE") googlemaps.geocode(ctx, "Sesame St.") self.assertEquals(1, len(responses.calls)) url = urlparse.urlparse(responses.calls[0].request.url) - self.assertEquals("key=AIzaasdf&address=Sesame+St.", url.query) + self.assertEquals("key=YOUR-API-KEY-HERE&address=Sesame+St.", url.query) def test_hmac(self): """ @@ -95,7 +95,7 @@ def test_ua_sent(self): status=200, content_type='application/json') - ctx = googlemaps.Context(key="AIzaasdf") + ctx = googlemaps.Context(key="YOUR-API-KEY-HERE") googlemaps.geocode(ctx, "Sesame St.") self.assertEquals(1, len(responses.calls)) @@ -119,7 +119,7 @@ def __call__(self, req): content_type='application/json', callback=request_callback()) - ctx = googlemaps.Context(key="AIzaasdf") + ctx = googlemaps.Context(key="YOUR-API-KEY-HERE") googlemaps.geocode(ctx, "Sesame St.") self.assertEquals(2, len(responses.calls)) @@ -141,7 +141,7 @@ def __call__(self, req): content_type='application/json', callback=request_callback()) - ctx = googlemaps.Context(key="AIzaasdf") + ctx = googlemaps.Context(key="YOUR-API-KEY-HERE") googlemaps.geocode(ctx, "Sesame St.") self.assertEquals(2, len(responses.calls)) diff --git a/test/test_directions.py b/test/test_directions.py index b4a58be3..abf42be7 100644 --- a/test/test_directions.py +++ b/test/test_directions.py @@ -27,7 +27,7 @@ class DirectionsTest(unittest.TestCase): def setUp(self): - self.key = 'AIzaasdf' + self.key = 'YOUR-API-KEY-HERE' self.ctx = googlemaps.Context(self.key) @responses.activate diff --git a/test/test_distance_matrix.py b/test/test_distance_matrix.py index e14431bb..1e5d97a2 100644 --- a/test/test_distance_matrix.py +++ b/test/test_distance_matrix.py @@ -24,7 +24,7 @@ class DistanceMatrixTest(unittest.TestCase): def setUp(self): - self.key = 'AIzaasdf' + self.key = 'YOUR-API-KEY-HERE' self.ctx = googlemaps.Context(self.key) @responses.activate diff --git a/test/test_elevation.py b/test/test_elevation.py index 0c04b49f..3ca71231 100644 --- a/test/test_elevation.py +++ b/test/test_elevation.py @@ -26,7 +26,7 @@ class ElevationTest(unittest.TestCase): def setUp(self): - self.key = 'AIzaasdf' + self.key = 'YOUR-API-KEY-HERE' self.ctx = googlemaps.Context(self.key) @responses.activate diff --git a/test/test_geocoding.py b/test/test_geocoding.py index 61f04c03..4752ea17 100644 --- a/test/test_geocoding.py +++ b/test/test_geocoding.py @@ -26,7 +26,7 @@ class GeocodingTest(unittest.TestCase): def setUp(self): - self.key = 'AIzaasdf' + self.key = 'YOUR-API-KEY-HERE' self.ctx = googlemaps.Context(self.key) @responses.activate diff --git a/test/test_timezone.py b/test/test_timezone.py index fa11daec..6a2e0088 100644 --- a/test/test_timezone.py +++ b/test/test_timezone.py @@ -27,7 +27,7 @@ class TimezoneTest(unittest.TestCase): def setUp(self): self.c = googlemaps.Context( - key="AIzaSyDyZdCabN8GKh786tdj16gq80xalbbfqDM", + key="YOUR-API-KEY-HERE", timeout=5) def test_los_angeles(self):