diff --git a/mycity/mycity/test/test_constants.py b/mycity/mycity/test/test_constants.py index 1b5891cf..b36003ee 100644 --- a/mycity/mycity/test/test_constants.py +++ b/mycity/mycity/test/test_constants.py @@ -44,25 +44,6 @@ "postalCode": "02138" } -# gis_utils.get_closest_feature -GOOGLE_MAPS_JSON = [ - { - 'Driving distance': 2458, - 'Driving distance text': '1.5 mi', - 'Driving time': 427, - 'Driving time text': '7 mins', - 'test': '94 Sawyer Ave Boston, MA' - }, - { - 'Driving distance': 692625, - 'Driving distance text': '430 mi', - 'Driving time': 24533, - 'Driving time text': '6 hours 49 mins', - 'test': '4 Olivewood Ct Greenbelt, MD' - } -] - - # gis_utils._get_dest_addresses_from_features PARKING_LOT_FEATURES = [ [ @@ -270,7 +251,6 @@ 'opts': { 'app_search_desc': None, 'notification_days': None, - 'disable_google_geocoder': True, 'disable_social': None, 'app_search_title': None, 'forced_widget_page': None, @@ -282,7 +262,6 @@ 'disable_print_download': None, 'arcgis_geocoder': None, 'pdf_header_center_html': None, - 'google_geocoder': None, 'app_navigation_page2': 'app_navigation_tabs', 'pdf_show_zones': None, 'require_explicit_consent': None, diff --git a/mycity/mycity/test/test_data/google_maps_json_response b/mycity/mycity/test/test_data/google_maps_json_response deleted file mode 100644 index ee61ea1d..00000000 --- a/mycity/mycity/test/test_data/google_maps_json_response +++ /dev/null @@ -1,3 +0,0 @@ -# json returned from successful call to Google Maps API -{'destination_addresses': ['115 Harvard Ave, Boston, MA 02134, USA', '398 Market St, Boston, MA 02135, USA', 'Soldiers Field Park 1, 111 Western Ave, Boston, MA 02163, USA', '1891 Centre St, West Roxbury, MA 02132, USA', '41 Corey St, Boston, MA 02129, USA', '1 Ave de Lafayette, Boston, MA 02111, USA', '450 W Broadway, Boston, MA 02127, USA', '652 1/2 E Broadway, Boston, MA 02127, USA', '12 Drydock Ave, Boston, MA 02210, USA', '835 Columbus Ave, Boston, MA 02120, USA', '10 Gainsborough St, Boston, MA 02115, USA', '50 Dalton St, Boston, MA 02115, USA', '199 13th St, Boston, MA 02129, USA', '581 Washington St, Boston, MA 02111, USA', '16 Hamlet St, Boston, MA 02125, USA', '191 Adams St, Dorchester, MA 02122, USA', '730-732 Dudley St, Dorchester, MA 02125, USA', '8 Belden St, Boston, MA 02125, USA', '20 Georgia St, Boston, MA 02121, USA', '254-258 Bowdoin St, Boston, MA 02125, USA', '629 Washington St, Boston, MA 02111, USA', '25 Blue Hill Avenue, Boston, MA 02119, USA', '40 Porter St, Boston, MA 02130, USA', '166 London St #180, Boston, MA 02128, USA', '36 Bennington St, Boston, MA 02128, USA', '1269 Hyde Park Ave, Boston, MA 02136, USA', '37 Winthrop St, Charlestown, MA 02129, USA', '3042 Washington St, Boston, MA 02119, USA', '737 Centre St, Boston, MA 02130, USA', '352 Centre St, Dorchester, MA 02122, USA', '3087 Washington St, Boston, MA 02119, USA', '490 Centre St, Boston, MA 02130, USA', '451 River St, Boston, MA 02126, USA', '23 Fairway St, Boston, MA 02126, USA', '10 Taft Hill Terrace, Boston, MA 02131, USA', '30 Ruggles St, Boston, MA 02120, USA', 'Warren St & Ziegler St, Boston, MA 02119, USA', '353 Dudley St, Boston, MA 02119, USA', '14 Roxbury St, Boston, MA 02119, USA', '0 Charles St, Boston, MA 02114, USA', '415 Summer St, Boston, MA 02210, USA', 'Fenway Triangle Trilogy, 180 Brookline Ave, Boston, MA 02215, USA', '1310 Boylston St, Boston, MA 02215, USA', '150 Huntington Ave, Boston, MA 02115, USA', '111 Huntington Avenue, 800 Boylston St, Boston, MA 02199, USA', '400 Stuart St, Boston, MA 02116, USA', 'Landmark Center, 401 Park Dr, Boston, MA 02215, USA', '235 Huntington Ave, Boston, MA 02115, USA'], 'origin_addresses': ['46 Everdean St, Dorchester, MA 02122, USA'], 'rows': [{'elements': [{'distance': {'text': '9.0 mi', 'value': 14483}, 'duration': {'text': '20 mins', 'value': 1210}, 'status': 'OK'}, {'distance': {'text': '10.2 mi', 'value': 16454}, 'duration': {'text': '23 mins', 'value': 1351}, 'status': 'OK'}, {'distance': {'text': '8.4 mi', 'value': 13471}, 'duration': {'text': '18 mins', 'value': 1096}, 'status': 'OK'}, {'distance': {'text': '7.6 mi', 'value': 12199}, 'duration': {'text': '27 mins', 'value': 1623}, 'status': 'OK'}, {'distance': {'text': '6.6 mi', 'value': 10647}, 'duration': {'text': '18 mins', 'value': 1103}, 'status': 'OK'}, {'distance': {'text': '4.5 mi', 'value': 7239}, 'duration': {'text': '14 mins', 'value': 826}, 'status': 'OK'}, {'distance': {'text': '3.0 mi', 'value': 4835}, 'duration': {'text': '11 mins', 'value': 632}, 'status': 'OK'}, {'distance': {'text': '3.1 mi', 'value': 5064}, 'duration': {'text': '10 mins', 'value': 596}, 'status': 'OK'}, {'distance': {'text': '4.3 mi', 'value': 6876}, 'duration': {'text': '13 mins', 'value': 778}, 'status': 'OK'}, {'distance': {'text': '4.4 mi', 'value': 7145}, 'duration': {'text': '15 mins', 'value': 873}, 'status': 'OK'}, {'distance': {'text': '4.5 mi', 'value': 7314}, 'duration': {'text': '17 mins', 'value': 1027}, 'status': 'OK'}, {'distance': {'text': '8.6 mi', 'value': 13884}, 'duration': {'text': '19 mins', 'value': 1137}, 'status': 'OK'}, {'distance': {'text': '6.8 mi', 'value': 11005}, 'duration': {'text': '19 mins', 'value': 1119}, 'status': 'OK'}, {'distance': {'text': '4.5 mi', 'value': 7181}, 'duration': {'text': '14 mins', 'value': 850}, 'status': 'OK'}, {'distance': {'text': '1.8 mi', 'value': 2875}, 'duration': {'text': '9 mins', 'value': 529}, 'status': 'OK'}, {'distance': {'text': '0.7 mi', 'value': 1090}, 'duration': {'text': '4 mins', 'value': 242}, 'status': 'OK'}, {'distance': {'text': '1.7 mi', 'value': 2785}, 'duration': {'text': '8 mins', 'value': 487}, 'status': 'OK'}, {'distance': {'text': '1.7 mi', 'value': 2741}, 'duration': {'text': '8 mins', 'value': 485}, 'status': 'OK'}, {'distance': {'text': '2.4 mi', 'value': 3905}, 'duration': {'text': '12 mins', 'value': 713}, 'status': 'OK'}, {'distance': {'text': '1.3 mi', 'value': 2040}, 'duration': {'text': '6 mins', 'value': 377}, 'status': 'OK'}, {'distance': {'text': '4.4 mi', 'value': 7059}, 'duration': {'text': '13 mins', 'value': 798}, 'status': 'OK'}, {'distance': {'text': '2.7 mi', 'value': 4389}, 'duration': {'text': '13 mins', 'value': 789}, 'status': 'OK'}, {'distance': {'text': '4.1 mi', 'value': 6519}, 'duration': {'text': '19 mins', 'value': 1115}, 'status': 'OK'}, {'distance': {'text': '8.4 mi', 'value': 13526}, 'duration': {'text': '20 mins', 'value': 1177}, 'status': 'OK'}, {'distance': {'text': '8.3 mi', 'value': 13384}, 'duration': {'text': '18 mins', 'value': 1090}, 'status': 'OK'}, {'distance': {'text': '8.6 mi', 'value': 13764}, 'duration': {'text': '18 mins', 'value': 1105}, 'status': 'OK'}, {'distance': {'text': '6.5 mi', 'value': 10395}, 'duration': {'text': '19 mins', 'value': 1119}, 'status': 'OK'}, {'distance': {'text': '3.2 mi', 'value': 5155}, 'duration': {'text': '16 mins', 'value': 968}, 'status': 'OK'}, {'distance': {'text': '4.9 mi', 'value': 7887}, 'duration': {'text': '20 mins', 'value': 1210}, 'status': 'OK'}, {'distance': {'text': '0.9 mi', 'value': 1381}, 'duration': {'text': '5 mins', 'value': 296}, 'status': 'OK'}, {'distance': {'text': '3.6 mi', 'value': 5759}, 'duration': {'text': '16 mins', 'value': 958}, 'status': 'OK'}, {'distance': {'text': '4.6 mi', 'value': 7420}, 'duration': {'text': '21 mins', 'value': 1269}, 'status': 'OK'}, {'distance': {'text': '5.0 mi', 'value': 7971}, 'duration': {'text': '13 mins', 'value': 767}, 'status': 'OK'}, {'distance': {'text': '6.5 mi', 'value': 10414}, 'duration': {'text': '15 mins', 'value': 873}, 'status': 'OK'}, {'distance': {'text': '5.1 mi', 'value': 8188}, 'duration': {'text': '21 mins', 'value': 1267}, 'status': 'OK'}, {'distance': {'text': '4.2 mi', 'value': 6774}, 'duration': {'text': '14 mins', 'value': 816}, 'status': 'OK'}, {'distance': {'text': '4.3 mi', 'value': 6885}, 'duration': {'text': '14 mins', 'value': 869}, 'status': 'OK'}, {'distance': {'text': '2.5 mi', 'value': 4059}, 'duration': {'text': '12 mins', 'value': 737}, 'status': 'OK'}, {'distance': {'text': '4.4 mi', 'value': 7119}, 'duration': {'text': '15 mins', 'value': 929}, 'status': 'OK'}, {'distance': {'text': '6.8 mi', 'value': 10989}, 'duration': {'text': '16 mins', 'value': 946}, 'status': 'OK'}, {'distance': {'text': '4.4 mi', 'value': 7109}, 'duration': {'text': '14 mins', 'value': 866}, 'status': 'OK'}, {'distance': {'text': '8.8 mi', 'value': 14086}, 'duration': {'text': '19 mins', 'value': 1162}, 'status': 'OK'}, {'distance': {'text': '8.5 mi', 'value': 13733}, 'duration': {'text': '17 mins', 'value': 1027}, 'status': 'OK'}, {'distance': {'text': '4.6 mi', 'value': 7354}, 'duration': {'text': '17 mins', 'value': 1024}, 'status': 'OK'}, {'distance': {'text': '4.6 mi', 'value': 7481}, 'duration': {'text': '17 mins', 'value': 1048}, 'status': 'OK'}, {'distance': {'text': '4.6 mi', 'value': 7433}, 'duration': {'text': '18 mins', 'value': 1065}, 'status': 'OK'}, {'distance': {'text': '9.2 mi', 'value': 14744}, 'duration': {'text': '20 mins', 'value': 1174}, 'status': 'OK'}, {'distance': {'text': '4.9 mi', 'value': 7808}, 'duration': {'text': '19 mins', 'value': 1117}, 'status': 'OK'}]}], 'status': 'OK'} - diff --git a/mycity/mycity/test/unit_tests/test_finder_csv.py b/mycity/mycity/test/unit_tests/test_finder_csv.py index b2baa27c..4182ba37 100644 --- a/mycity/mycity/test/unit_tests/test_finder_csv.py +++ b/mycity/mycity/test/unit_tests/test_finder_csv.py @@ -1,4 +1,3 @@ -import mycity.utilities.google_maps_utils as g_maps_utils import mycity.test.unit_tests.base as base from mycity.utilities.finder.FinderCSV import FinderCSV @@ -13,7 +12,7 @@ def test_prep_func(keys): fake_url = "www.fake.com" address_key = "Address" output_speech = "Trying to get {name}, {" + address_key + "}, " \ - + "{" + g_maps_utils.DRIVING_DISTANCE_TEXT_KEY + "}." + + "{Driving distance text}." self.request.session_attributes['currentAddress'] = \ '1000 Dorchester Ave' self.finder = FinderCSV(self.request, fake_url, address_key, @@ -24,11 +23,10 @@ def tearDown(self): super().tearDown() def test_get_output_speech_with_success(self): - distance = g_maps_utils.DRIVING_DISTANCE_TEXT_KEY self.finder.set_output_speech({ 'Address': '123 Fake St Boston, MA', 'name': 'The Place', - distance: '100 miles away' + 'Driving distance text': '100 miles away' }) self.assertEqual( "Trying to get The Place, 123 Fake St Boston, MA, 100 miles away.", diff --git a/mycity/mycity/test/unit_tests/test_gis_utils.py b/mycity/mycity/test/unit_tests/test_gis_utils.py index 69d8d485..f741bc50 100644 --- a/mycity/mycity/test/unit_tests/test_gis_utils.py +++ b/mycity/mycity/test/unit_tests/test_gis_utils.py @@ -2,44 +2,10 @@ import mycity.test.test_constants as test_constants import mycity.test.unit_tests.base as base import mycity.utilities.gis_utils as gis_utils -import mycity.utilities.google_maps_utils as g_maps_utils class GISUtilitiesTestCase(base.BaseTestCase): - @mock.patch( - 'mycity.utilities.google_maps_utils._get_driving_info', - return_value=test_constants.GOOGLE_MAPS_JSON - ) - def test_get_closest_feature(self, mock_get_driving_info): - test_origin = "46 Everdean St Boston, MA" - test_features = [ - ['close', '94 Sawyer Ave Boston, MA'], - ['far', '4 Olivewood Ct Greenbelt, MD'] - ] - feature_address_index = 1 - feature_type = "test" - error_message = "Test error message" - result = gis_utils.get_closest_feature( - test_origin, - feature_address_index, - feature_type, - error_message, - test_features - ) - self.assertEqual( - "94 Sawyer Ave Boston, MA", - result[feature_type] - ) - self.assertEqual( - '7 mins', - result[g_maps_utils.DRIVING_TIME_TEXT_KEY] - ) - self.assertEqual( - '1.5 mi', - result[g_maps_utils.DRIVING_DISTANCE_TEXT_KEY] - ) - def test_get_dest_addresses_from_features(self): to_test = \ gis_utils._get_dest_addresses_from_features( diff --git a/mycity/mycity/test/unit_tests/test_google_maps_utils.py b/mycity/mycity/test/unit_tests/test_google_maps_utils.py deleted file mode 100644 index 95fd4a90..00000000 --- a/mycity/mycity/test/unit_tests/test_google_maps_utils.py +++ /dev/null @@ -1,34 +0,0 @@ -import unittest -import mycity.test.unit_tests.base as base -import mycity.utilities.google_maps_utils as g_maps_utils - - -class TestGoogleMapsUtilities(base.BaseTestCase): - - @unittest.skip('need a mocked JSON for this function') - def test_combine_driving_data_with_destinations(self): - location_type = 'Fake location' - closest_location_info = { - 'Driving distance': 'fake', - 'Driving distance text': 'also fake', - 'Driving time': 'triply fake', - 'Driving time text': 'fake like a mug', - 'location_type': 'fake fake fake fake' - } - to_test = g_maps_utils.combine_driving_data_with_destinations( - location_type, - closest_location_info - ) - self.assertIn(g_maps_utils.DRIVING_DISTANCE_TEXT_KEY, to_test) - self.assertIn(g_maps_utils.DRIVING_TIME_TEXT_KEY, to_test) - self.assertIn(location_type, to_test) - self.assertNotIn('Driving time', to_test) - self.assertNotIn('Driving distance', to_test) - - def test_setup_google_maps_query_params(self): - origin = "46 Everdean St Boston, MA" - dests = ["123 Fake St Boston, MA", "1600 Penn Ave Washington, DC"] - to_test = g_maps_utils._setup_google_maps_query_params(origin, dests) - self.assertEqual(origin, to_test["origins"]) - self.assertEqual(dests, to_test["destinations"].split("|")) - self.assertEqual("imperial", to_test["units"]) diff --git a/mycity/mycity/utilities/finder/Finder.py b/mycity/mycity/utilities/finder/Finder.py index 4e9c1e22..d7613683 100644 --- a/mycity/mycity/utilities/finder/Finder.py +++ b/mycity/mycity/utilities/finder/Finder.py @@ -138,7 +138,7 @@ def set_output_speech(self, format_keys): def get_all_destinations(self, records): """ - Return a list of all destinations to pass to Google Maps API + Return a list of all destinations in the records :param records: a list of all location records, records are stored as dictionaries diff --git a/mycity/mycity/utilities/finder/FinderCSV.py b/mycity/mycity/utilities/finder/FinderCSV.py index 693fbdcb..ccb50bc2 100644 --- a/mycity/mycity/utilities/finder/FinderCSV.py +++ b/mycity/mycity/utilities/finder/FinderCSV.py @@ -46,7 +46,7 @@ def __init__( and modify fields in the returned record for output_speech formatted string :param filter: filter that we can use to remove records from csv - file before using google_maps to find distances and + file before using a service to find distances and driving_times """ diff --git a/mycity/mycity/utilities/gis_utils.py b/mycity/mycity/utilities/gis_utils.py index e0aec88e..20582307 100644 --- a/mycity/mycity/utilities/gis_utils.py +++ b/mycity/mycity/utilities/gis_utils.py @@ -9,66 +9,12 @@ from arcgis.gis import * from arcgis.features import FeatureLayer from arcgis.geocoding import geocode -import mycity.utilities.google_maps_utils as g_maps_utils import logging logger = logging.getLogger(__name__) dev_gis = GIS() # this is needed to use geocoding -def get_closest_feature(origin, feature_address_index, - feature_type, error_message, features): - """ - Calculates the nearest feature given an origin - - :param origin: String containing starting address we calculate - shortest distance from - :param feature_address_index: index where address in features - is stored - :param feature_type: string describing the type of feature we are - calculating the shortest distance to - :param error_message: string to print if we fail to find a closest feature - :param features: list of features fetched from FeatureServer - :return: dictionary with address, distance, and - driving time for closest feature - """ - logger.debug( - 'origin received: ' + str(origin) + - ', feature_address_index received:' + str(feature_address_index) + - ', feature_type received: ' + str(feature_type) + - ', error_message received:' + str(error_message) + - ', features received (printing first five):' + str(features[:5]) + - ', count(features): ' + str(len(features)) - ) - - dest_addresses = _get_dest_addresses_from_features( - feature_address_index, - features - ) - location_driving_info = g_maps_utils._get_driving_info( - origin, - feature_type, - dest_addresses - ) - if len(location_driving_info) > 0: - closest_location_info = min( - location_driving_info, - key=lambda x: x[g_maps_utils.DRIVING_DISTANCE_VALUE_KEY] - ) - else: - logger.debug(error_message) - closest_location_info = { - feature_type: False, - g_maps_utils.DRIVING_DISTANCE_TEXT_KEY: False, - g_maps_utils.DRIVING_TIME_TEXT_KEY: False - } - closest_location_info = g_maps_utils.parse_closest_location_info( - feature_type, - closest_location_info - ) - return closest_location_info - - def get_features_from_feature_server(url, query): """ Given a url to a City of Boston Feature Server, return a list diff --git a/mycity/mycity/utilities/google_maps_utils.py b/mycity/mycity/utilities/google_maps_utils.py deleted file mode 100644 index 3ad3423d..00000000 --- a/mycity/mycity/utilities/google_maps_utils.py +++ /dev/null @@ -1,156 +0,0 @@ -""" -Utility functions using Google Maps to find driving distances/times from -an origin address to a list of destinations -""" - -import os -import requests -import logging - -logger = logging.getLogger(__name__) - - -GOOGLE_MAPS_API_KEY = os.environ['GOOGLE_MAPS_API_KEY'] -GOOGLE_MAPS_URL = "https://maps.googleapis.com/maps/api/distancematrix/json" -DRIVING_DISTANCE_VALUE_KEY = "Driving distance" -DRIVING_DISTANCE_TEXT_KEY = "Driving distance text" -DRIVING_TIME_VALUE_KEY = "Driving time" -DRIVING_TIME_TEXT_KEY = "Driving time text" - - -def _get_driving_info(origin, location_type, destinations): - """ - Gets the driving info from the provided origin address to each destination - address - - :param origin: string containing driving starting address - :param location_type: string that identifies type of location we're getting - directions to - :param destinations: list of destination address strings (to calculate - driving info from origin address) - :return: list of dictionaries representing driving data for each - destination address with address, distance, and driving time - from origin address - """ - logger.debug( - 'origin received: ' + str(origin) + - ', feature_type received: ' + str(location_type) + - ', destinations received (last five): ' + str(destinations[:5]) + - ', count(destinations): ' + str(len(destinations)) - ) - - url_parameters = _setup_google_maps_query_params(origin, destinations) - driving_directions_url = GOOGLE_MAPS_URL - driving_infos = None - with requests.Session() as session: - response = session.get(driving_directions_url, params=url_parameters) - if response.status_code == requests.codes.ok: - all_driving_data = response.json() - driving_infos = combine_driving_data_with_destinations( - all_driving_data, - location_type, - destinations - ) - else: - logger.warning("Failed to get driving directions") - - return driving_infos - - -def _setup_google_maps_query_params(origin, destinations): - """ - Builds a dictionary for querying Google Maps - - :param origin: "from" address in query - :param destinations: "to" addresses in query - :return: a dictionary to use as url parameters for query - """ - logger.debug( - 'origin received: ' + str(origin) + - ', destinations received (last five): ' + str(destinations[:5]) + - ', count(destinations): ' + str(len(destinations)) - ) - return {"origins": origin, - "destinations": '|'.join(destinations), - "key": GOOGLE_MAPS_API_KEY, - "units": "imperial"} - - -def combine_driving_data_with_destinations( - all_driving_data, - location_type, - destinations -): - """ - Retrieve data from Google Maps query into dictionary with data stored as - key, value pairs (our keys being the constants defined at beginning - of file) and append - - :param all_driving_data: JSON blob returned from Google Maps query - :param location_type: string that identifies type of location - we're driving to - :param destinations: list of strings representing destination addresses - :return: list of dictionaries representing driving data for - each address - """ - logger.debug( - 'all_driving_data received: ' + str(all_driving_data) + - ', location_type received: ' + str(location_type) + - ', destinations received (last five): ' + str(destinations[:5]) + - ', count(destinations): ' + str(len(destinations)) - ) - - driving_infos = [] - try: - driving_data_row = all_driving_data["rows"][0] - for (driving_data, address) in zip( - driving_data_row["elements"], - destinations - ): - try: - driving_info = { - DRIVING_DISTANCE_VALUE_KEY: - driving_data["distance"]["value"], - DRIVING_DISTANCE_TEXT_KEY: - driving_data["distance"]["text"], - DRIVING_TIME_VALUE_KEY: - driving_data["duration"]["value"], - DRIVING_TIME_TEXT_KEY: - driving_data["duration"]["text"], - location_type: address} - driving_infos.append(driving_info) - except KeyError: - logger.debug( - "Could not parse driving info {}".format(driving_data) - ) - except KeyError: - pass - finally: - return driving_infos - - -def parse_closest_location_info(location_type, closest_location_info): - """ - Return a sub-dictionary of the dictionary returned by the Google Maps - estimated driving time call - - :param location_type: string that describes the type of location we - are finding the closest instance of - :param closest_location_info: a dictionary with keys - 'Driving distance', 'Driving distance text', 'Driving time', - 'Driving time text', feature_type. - :return: a trimmed dictionary with keys: feature_type, - DRIVING_DISTANCE_TEXT_KEY, - DRIVING_TIME_TEXT_KEY - """ - logger.debug( - 'location_type received: ' + str(location_type) + - ', closest_location_info received: ' + str(closest_location_info) - ) - - keys_to_keep = [location_type, DRIVING_DISTANCE_TEXT_KEY, DRIVING_TIME_TEXT_KEY] - return {key:closest_location_info[key] for key in keys_to_keep} - - - - diff --git a/mycity/run_tests.bat b/mycity/run_tests.bat index 129867b5..acd09f4b 100644 --- a/mycity/run_tests.bat +++ b/mycity/run_tests.bat @@ -1,9 +1,7 @@ @echo off REM Dummy variables must be set in order to avoid key errors during testing. REM Note: -REM See issue #187 for removing GOOGLE_MAPS_API_KEY can be removed along with this comment REM SLACK_WEBHOOKS_URL is required for AWS Lamba and is set up correctly if not defined SLACK_WEBHOOKS_URL set SLACK_WEBHOOKS_URL=FAKEFAKEFAKE -if not defined GOOGLE_MAPS_API_KEY set GOOGLE_MAPS_API_KEY=FAKEFAKEFAKE python -m unittest discover -v -s mycity\test diff --git a/mycity/run_tests.sh b/mycity/run_tests.sh index a8b0bd44..5b7b57f1 100755 --- a/mycity/run_tests.sh +++ b/mycity/run_tests.sh @@ -1,9 +1,3 @@ - -# see issue #187 to determine if GOOGLE_MAPS_API can be removed along with this comment. -if [ -z "${GOOGLE_MAPS_API_KEY}" ];then - export GOOGLE_MAPS_API_KEY=FAKEFAKEFAKE -fi - if [ -z "${SLACK_WEBHOOKS_URL}" ]; then export SLACK_WEBHOOKS_URL=FAKEFAKEFAKE fi