api_key -> mapbox_api_key rename refactor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
def api_key():
|
||||
def mapbox_api_key():
|
||||
"""Returns Mapbox API key. Requires setting MAPBOX_API_KEY environment variable."""
|
||||
return os.environ['MAPBOX_API_KEY']
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ WELL_KNOWN_LATITUDE = 41.668654
|
||||
|
||||
class MapboxGeocoderTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.geocoder = MapboxGeocoder(token=credentials.api_key(), logger=Mock())
|
||||
self.geocoder = MapboxGeocoder(token=credentials.mapbox_api_key(), logger=Mock())
|
||||
|
||||
def test_invalid_token(self):
|
||||
invalid_geocoder = MapboxGeocoder(token=INVALID_TOKEN, logger=Mock())
|
||||
|
||||
@@ -15,7 +15,7 @@ VALID_ORIGIN = Coordinate(-73.989, 40.733)
|
||||
class MapboxIsolinesTestCase(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
matrix_client = MapboxMatrixClient(token=credentials.api_key(), logger=Mock())
|
||||
matrix_client = MapboxMatrixClient(token=credentials.mapbox_api_key(), logger=Mock())
|
||||
self.mapbox_isolines = MapboxIsolines(matrix_client, logger=Mock())
|
||||
|
||||
def test_calculate_isochrone(self):
|
||||
|
||||
@@ -22,7 +22,7 @@ INVALID_PROFILE = 'invalid_profile'
|
||||
|
||||
class MapboxMatrixTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.matrix_client = MapboxMatrixClient(token=credentials.api_key(),
|
||||
self.matrix_client = MapboxMatrixClient(token=credentials.mapbox_api_key(),
|
||||
logger=Mock())
|
||||
|
||||
def test_invalid_profile(self):
|
||||
|
||||
@@ -31,7 +31,7 @@ WELL_KNOWN_LENGTH = 1317.9
|
||||
|
||||
class MapboxRoutingTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.routing = MapboxRouting(token=credentials.api_key(), logger=Mock())
|
||||
self.routing = MapboxRouting(token=credentials.mapbox_api_key(), logger=Mock())
|
||||
|
||||
def test_invalid_profile(self):
|
||||
with self.assertRaises(ValueError):
|
||||
|
||||
Reference in New Issue
Block a user