Skip to content

Commit

Permalink
Fixing test_get_json_geo
Browse files Browse the repository at this point in the history
Replaced address called with one that I know the container has (since the function is used elsewhere in the container).

Decided to use the same format as I used for test_geofabrik_and_nominatim to compare the results.

Test is passing locally.
  • Loading branch information
nataliejschultz committed Sep 20, 2023
1 parent b9d500e commit baa6bee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions emission/individual_tests/TestNominatim.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ def test_make_url_geo(self):

#we ignore the place_id because it is an internal Nominatim identifier
def test_get_json_geo(self):
expected_result = "Hartford Pike"
actual_result = eco.Geocoder.get_json_geo("Old Hartford Pike, Scituate, RI 02857")[0]["name"]
self.assertEqual(expected_result, actual_result)
expected_result = {'place_id': 132490, 'licence': 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright', 'osm_type': 'way', 'osm_id': 141567710, 'boundingbox': ['41.8325787', '41.8332278', '-71.4161848', '-71.4152064'], 'lat': '41.8330097', 'lon': '-71.41568124868104', 'display_name': 'State of Rhode Island Department of Administration, 1, Park Street, Downtown, Providence, Providence County, 02908, United States', 'class': 'building', 'type': 'civic', 'importance': 1.75001}
actual_result = eco.Geocoder.get_json_geo("State of Rhode Island Department of Administration, 1, Park Street, Downtown, Providence, Providence County, 02908, United States")[0]
key_list = ['osm_id', 'boundingbox', 'display_name']
for k in key_list:
self.assertEqual(expected_result[k], actual_result[k])

def test_geocode(self):
expected_result_lon = Coordinate(41.8239891, -71.4128343).get_lon()
Expand Down

0 comments on commit baa6bee

Please sign in to comment.