From 9155f18d31fe5180d0d57182f330c6ad94d08dc9 Mon Sep 17 00:00:00 2001 From: David Bonnes Date: Thu, 2 Jan 2025 15:50:41 +0000 Subject: [PATCH] rename symbols --- tests/tests/test_v0_auth.py | 14 +++++++------- tests/tests/test_v2_auth.py | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/tests/test_v0_auth.py b/tests/tests/test_v0_auth.py index 970a4d8..dd7343c 100644 --- a/tests/tests/test_v0_auth.py +++ b/tests/tests/test_v0_auth.py @@ -14,7 +14,7 @@ from evohomeasync import exceptions as exc from evohomeasync.auth import _APPLICATION_ID -from tests.const import HEADERS_CRED_V0 as HEADERS_CRED, URL_CRED_V0 as URL_CRED +from tests.const import HEADERS_CRED_V0, URL_CRED_V0 if TYPE_CHECKING: from pathlib import Path @@ -60,13 +60,13 @@ def server_response() -> dict[str, dict[str, Any] | str]: "message": "The email or password provided is incorrect.", } ] - rsp.post(URL_CRED, status=HTTPStatus.UNAUTHORIZED, payload=response) + rsp.post(URL_CRED_V0, status=HTTPStatus.UNAUTHORIZED, payload=response) with pytest.raises(exc.AuthenticationFailedError): await session_manager.get_session_id() rsp.assert_called_once_with( - URL_CRED, HTTPMethod.POST, headers=HEADERS_CRED, data=data_password + URL_CRED_V0, HTTPMethod.POST, headers=HEADERS_CRED_V0, data=data_password ) assert session_manager.is_session_id_valid() is False @@ -76,12 +76,12 @@ def server_response() -> dict[str, dict[str, Any] | str]: payload = server_response() with aioresponses() as rsp: - rsp.post(URL_CRED, payload=payload) + rsp.post(URL_CRED_V0, payload=payload) assert await session_manager.get_session_id() == payload["sessionId"] rsp.assert_called_once_with( - URL_CRED, HTTPMethod.POST, headers=HEADERS_CRED, data=data_password + URL_CRED_V0, HTTPMethod.POST, headers=HEADERS_CRED_V0, data=data_password ) assert session_manager.is_session_id_valid() is True @@ -110,12 +110,12 @@ def server_response() -> dict[str, dict[str, Any] | str]: payload = server_response() with aioresponses() as rsp: - rsp.post(URL_CRED, payload=payload) + rsp.post(URL_CRED_V0, payload=payload) assert await session_manager.get_session_id() == payload["sessionId"] rsp.assert_called_once_with( - URL_CRED, HTTPMethod.POST, headers=HEADERS_CRED, data=data_password + URL_CRED_V0, HTTPMethod.POST, headers=HEADERS_CRED_V0, data=data_password ) assert session_manager.is_session_id_valid() is True diff --git a/tests/tests/test_v2_auth.py b/tests/tests/test_v2_auth.py index c179407..2587598 100644 --- a/tests/tests/test_v2_auth.py +++ b/tests/tests/test_v2_auth.py @@ -14,7 +14,7 @@ from cli.auth import CredentialsManager from evohomeasync2 import exceptions as exc -from tests.const import HEADERS_CRED_V2 as HEADERS_CRED, URL_CRED_V2 as URL_CRED +from tests.const import HEADERS_CRED_V2, URL_CRED_V2 if TYPE_CHECKING: from pathlib import Path @@ -63,13 +63,13 @@ def server_response() -> dict[str, int | str]: response = { "error": "invalid_grant", } - rsp.post(URL_CRED, status=HTTPStatus.UNAUTHORIZED, payload=response) + rsp.post(URL_CRED_V2, status=HTTPStatus.UNAUTHORIZED, payload=response) with pytest.raises(exc.AuthenticationFailedError): await token_manager.get_access_token() rsp.assert_called_once_with( - URL_CRED, HTTPMethod.POST, headers=HEADERS_CRED, data=data_password + URL_CRED_V2, HTTPMethod.POST, headers=HEADERS_CRED_V2, data=data_password ) assert token_manager.is_access_token_valid() is False @@ -79,12 +79,12 @@ def server_response() -> dict[str, int | str]: payload = server_response() with aioresponses() as rsp: - rsp.post(URL_CRED, payload=payload) + rsp.post(URL_CRED_V2, payload=payload) assert await token_manager.get_access_token() == payload["access_token"] rsp.assert_called_once_with( - URL_CRED, HTTPMethod.POST, headers=HEADERS_CRED, data=data_password + URL_CRED_V2, HTTPMethod.POST, headers=HEADERS_CRED_V2, data=data_password ) assert token_manager.is_access_token_valid() is True @@ -116,12 +116,12 @@ def server_response() -> dict[str, int | str]: payload = server_response() with aioresponses() as rsp: - rsp.post(URL_CRED, payload=payload) + rsp.post(URL_CRED_V2, payload=payload) assert await token_manager.get_access_token() == payload["access_token"] rsp.assert_called_once_with( - URL_CRED, HTTPMethod.POST, headers=HEADERS_CRED, data=data_token + URL_CRED_V2, HTTPMethod.POST, headers=HEADERS_CRED_V2, data=data_token ) assert token_manager.is_access_token_valid() is True