From f8180a60d0c14af0d75b33ba6b8271f8579d1b1f Mon Sep 17 00:00:00 2001 From: Justin Poehnelt Date: Mon, 19 Aug 2019 13:25:46 -0700 Subject: [PATCH 1/2] fix imports and remove unused --- googlemaps/__init__.py | 6 +++--- googlemaps/distance_matrix.py | 1 - googlemaps/places.py | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/googlemaps/__init__.py b/googlemaps/__init__.py index 63f904c8..1c94fae5 100644 --- a/googlemaps/__init__.py +++ b/googlemaps/__init__.py @@ -18,7 +18,7 @@ __version__ = "3.0.2" from googlemaps.client import Client -import googlemaps.exceptions +from googlemaps import exceptions -# Allow sphinx to pick up these symbols for the documentation. -__all__ = ["Client"] + +__all__ = ["Client", "exceptions"] diff --git a/googlemaps/distance_matrix.py b/googlemaps/distance_matrix.py index f6a85e8c..1d848253 100755 --- a/googlemaps/distance_matrix.py +++ b/googlemaps/distance_matrix.py @@ -18,7 +18,6 @@ """Performs requests to the Google Maps Distance Matrix API.""" from googlemaps import convert -from googlemaps.convert import as_list def distance_matrix(client, origins, destinations, diff --git a/googlemaps/places.py b/googlemaps/places.py index 7f43b13c..76b94903 100644 --- a/googlemaps/places.py +++ b/googlemaps/places.py @@ -17,7 +17,6 @@ """Performs requests to the Google Places API.""" -from uuid import uuid4 as places_autocomplete_session_token from googlemaps import convert From da18da08eff9794341ae00b021f60e3a71c61f9b Mon Sep 17 00:00:00 2001 From: Justin Poehnelt Date: Mon, 19 Aug 2019 13:39:17 -0700 Subject: [PATCH 2/2] use uuid4 directly for session token in test --- googlemaps/test/test_places.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/googlemaps/test/test_places.py b/googlemaps/test/test_places.py index 4080b55f..ad0d0f37 100644 --- a/googlemaps/test/test_places.py +++ b/googlemaps/test/test_places.py @@ -18,12 +18,13 @@ """Tests for the places module.""" +import uuid + from types import GeneratorType import responses import googlemaps -from googlemaps.places import places_autocomplete_session_token import googlemaps.test as _test @@ -169,7 +170,7 @@ def test_autocomplete(self): body='{"status": "OK", "predictions": []}', status=200, content_type='application/json') - session_token = places_autocomplete_session_token() + session_token = uuid.uuid4().hex self.client.places_autocomplete('Google', session_token=session_token, offset=3, location=self.location,