|
14 | 14 |
|
15 | 15 | BING_MAPS_API_KEY = os.getenv("BING_MAPS_API_KEY") |
16 | 16 | MAPQUEST_API_KEY = os.getenv("MAPQUEST_API_KEY") |
17 | | -MAPZEN_API_KEY = os.getenv("MAPZEN_API_KEY") |
| 17 | +PELIAS_API_KEY = os.getenv("PELIAS_API_KEY") |
18 | 18 | GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY") |
19 | 19 | ESRI_CLIENT_ID = os.getenv("ESRI_CLIENT_ID") |
20 | 20 | ESRI_CLIENT_SECRET = os.getenv("ESRI_CLIENT_SECRET") |
@@ -44,9 +44,8 @@ class GeocoderTest(OmgeoTestCase): |
44 | 44 | BING_KEY_REQUIRED_MSG = 'Enter a Bing Maps API key to run the Bing tests.' |
45 | 45 | MAPQUEST_KEY_REQUIRED_MSG = 'Enter a MapQuest API key to run the MapQuest tests. '\ |
46 | 46 | 'Keys can be obtained at http://developer.mapquest.com/.' |
47 | | - MAPZEN_KEY_REQUIRED_MSG = 'Enter a Mapzen Search API key to run Mapzen ' \ |
48 | | - 'tests. Keys can be obtained at ' \ |
49 | | - 'https://mapzen.com/developers/sign_in.' |
| 47 | + PELIAS_KEY_REQUIRED_MSG = 'Enter a Pelias service search API key to run Pelias tests. '\ |
| 48 | + 'Keys can be obtained at https://geocode.earth/.' |
50 | 49 | GOOGLE_KEY_REQUIRED_MSG = 'Enter a Google API key to run Google tests.' |
51 | 50 | ESRI_KEY_REQUIRED_MSG = 'Enter a Esri Client ID & Secret to run authenticated Esri tests.' |
52 | 51 |
|
@@ -100,9 +99,9 @@ def setUp(self): |
100 | 99 | self.g_mapquest_ssl = Geocoder([['omgeo.services.MapQuestSSL', |
101 | 100 | {'settings': mapquest_settings}]]) |
102 | 101 |
|
103 | | - if MAPZEN_API_KEY is not None: |
104 | | - mapzen_settings = dict(api_key=MAPZEN_API_KEY) |
105 | | - self.g_mapzen = Geocoder([['omgeo.services.Mapzen', {'settings': mapzen_settings}]]) |
| 102 | + if PELIAS_API_KEY is not None: |
| 103 | + pelias_settings = dict(api_key=PELIAS_API_KEY) |
| 104 | + self.g_pelias = Geocoder([['omgeo.services.Pelias', {'settings': pelias_settings}]]) |
106 | 105 |
|
107 | 106 | if GOOGLE_API_KEY is not None: |
108 | 107 | self.g_google = Geocoder([['omgeo.services.Google', |
@@ -237,10 +236,10 @@ def test_geocode_mapquest_ssl(self): |
237 | 236 | candidates = self.g_mapquest_ssl.get_candidates(self.pq['azavea']) |
238 | 237 | self.assertEqual(len(candidates) > 0, True, 'No candidates returned.') |
239 | 238 |
|
240 | | - @unittest.skipIf(MAPZEN_API_KEY is None, MAPZEN_KEY_REQUIRED_MSG) |
241 | | - def test_geocode_mapzen(self): |
242 | | - """Test Azavea's address using Mapzen geocoder""" |
243 | | - candidates = self.g_mapzen.get_candidates(self.pq['azavea']) |
| 239 | + @unittest.skipIf(PELIAS_API_KEY is None, PELIAS_KEY_REQUIRED_MSG) |
| 240 | + def test_geocode_pelias(self): |
| 241 | + """Test Azavea's address using Pelias geocoder""" |
| 242 | + candidates = self.g_pelias.get_candidates(self.pq['azavea']) |
244 | 243 | self.assertEqual(len(candidates) > 0, True, 'No candidates returned.') |
245 | 244 |
|
246 | 245 | @unittest.skip("FIXME") |
|
0 commit comments