diff --git a/martapy/rail.py b/martapy/rail.py index 12f1a9b..effd997 100644 --- a/martapy/rail.py +++ b/martapy/rail.py @@ -99,7 +99,7 @@ def arrivals(self): @property def url(self): """``RailClient.base_url`` formatted with API key""" - return self.base_url.format(self.api_key) + return self.base_url.format(api_key=self.api_key) class Arrivals(list): diff --git a/tests/test_arrivals.py b/tests/test_arrivals.py index 0dea369..3cbb21e 100644 --- a/tests/test_arrivals.py +++ b/tests/test_arrivals.py @@ -10,7 +10,7 @@ def setUp(self): conf_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config.ini') test_config.read(conf_file) - api_key = test_config.get('rail', 'api_key') + api_key = test_config.get('rail', 'apikey') self.api_client = RailClient(api_key=api_key) self.r = self.api_client.arrivals()