diff --git a/pydantic_tfl_api/api_token.py b/pydantic_tfl_api/api_token.py index a99bc1a..06fae92 100644 --- a/pydantic_tfl_api/api_token.py +++ b/pydantic_tfl_api/api_token.py @@ -29,6 +29,5 @@ class ApiToken(): :param str app_key: Application Key from the API credentails """ - def __init__(self, app_id, app_key): - self.app_id = app_id + def __init__(self, app_key): self.app_key = app_key \ No newline at end of file diff --git a/pydantic_tfl_api/rest_client.py b/pydantic_tfl_api/rest_client.py index b676ab9..f3d85ba 100644 --- a/pydantic_tfl_api/rest_client.py +++ b/pydantic_tfl_api/rest_client.py @@ -36,7 +36,7 @@ class RestClient(): """ def __init__(self, api_token: ApiToken = None): - self.api_token = {"app_id": api_token.app_id, "app_key": api_token.app_key} if api_token else None + self.api_token = {"app_key": api_token.app_key} if api_token else None def send_request(self, location, params=None): return requests.get(base_url + location + "?" + self._get_query_strings(params)) diff --git a/tests/test_basic_tests.py b/tests/test_basic_tests.py index ac11232..778bc34 100644 --- a/tests/test_basic_tests.py +++ b/tests/test_basic_tests.py @@ -5,20 +5,19 @@ # to make sure that the pydantic models load # and that the TFL API connectivity is ok - although we'll have def test_create_api_token(): - api_token = ApiToken('your_api_token', 'app_key') - assert api_token.app_id == 'your_api_token' - assert api_token.app_key == 'app_key' + api_token = ApiToken('your_app_key') + assert api_token.app_key == 'your_app_key' def test_create_client_with_api_token(): # checks that the API key is being passed to the RestClient - api_token = ApiToken('your_api_token', 'app_key') + api_token = ApiToken('your_app_key') client = Client(api_token) - assert client.client.api_token['app_id'] == 'your_api_token' + assert client.client.api_token['app_key'] == 'your_app_key' def test_get_line_status_by_mode_rejected_with_invalid_api_key(): - api_token = ApiToken('your_api_token', 'app_key') + api_token = ApiToken('your_app_key') client = Client(api_token) - assert client.client.api_token['app_id'] == 'your_api_token' + assert client.client.api_token['app_key'] == 'your_app_key' # should get a 429 error inside an ApiError object result = client.get_line_status_by_mode('overground,tube') assert isinstance(result, ApiError)