From 267caf2365b4c42e03ba9c1122e81c2c522e81e3 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 13 Feb 2026 15:47:38 +0100 Subject: [PATCH] Use APPLICATION_CREDENTIALS_DOMAIN constant in tests (#162932) --- .../config_flow_oauth2/tests/test_config_flow.py | 3 ++- tests/components/aladdin_connect/conftest.py | 3 ++- tests/components/application_credentials/test_init.py | 8 ++++---- tests/components/august/conftest.py | 3 ++- tests/components/august/mocks.py | 3 ++- tests/components/ekeybionyx/test_config_flow.py | 3 ++- tests/components/electric_kiwi/conftest.py | 3 ++- tests/components/fitbit/conftest.py | 3 ++- tests/components/geocaching/test_config_flow.py | 3 ++- tests/components/google/conftest.py | 3 ++- tests/components/google/test_config_flow.py | 3 ++- tests/components/google_assistant_sdk/conftest.py | 3 ++- tests/components/google_drive/conftest.py | 3 ++- tests/components/google_mail/conftest.py | 5 +++-- tests/components/google_photos/conftest.py | 3 ++- tests/components/google_sheets/test_config_flow.py | 3 ++- tests/components/google_sheets/test_init.py | 3 ++- tests/components/google_tasks/conftest.py | 3 ++- tests/components/home_connect/conftest.py | 3 ++- tests/components/husqvarna_automower/conftest.py | 3 ++- tests/components/iotty/test_config_flow.py | 3 ++- tests/components/lametric/conftest.py | 3 ++- tests/components/mcp/conftest.py | 3 ++- tests/components/microbees/conftest.py | 3 ++- tests/components/miele/conftest.py | 3 ++- tests/components/monzo/conftest.py | 3 ++- tests/components/myuplink/conftest.py | 3 ++- tests/components/nest/conftest.py | 3 ++- tests/components/netatmo/conftest.py | 3 ++- tests/components/onedrive/conftest.py | 3 ++- tests/components/point/test_config_flow.py | 3 ++- tests/components/senz/conftest.py | 3 ++- tests/components/smartthings/conftest.py | 3 ++- tests/components/spotify/conftest.py | 3 ++- tests/components/tesla_fleet/__init__.py | 3 ++- tests/components/tesla_fleet/test_config_flow.py | 3 ++- tests/components/tibber/conftest.py | 3 ++- tests/components/twitch/conftest.py | 3 ++- tests/components/volvo/conftest.py | 3 ++- tests/components/watts/conftest.py | 3 ++- tests/components/withings/conftest.py | 3 ++- tests/components/xbox/conftest.py | 3 ++- tests/components/yale/mocks.py | 3 ++- tests/components/yolink/conftest.py | 3 ++- tests/components/youtube/conftest.py | 5 +++-- 45 files changed, 94 insertions(+), 50 deletions(-) diff --git a/script/scaffold/templates/config_flow_oauth2/tests/test_config_flow.py b/script/scaffold/templates/config_flow_oauth2/tests/test_config_flow.py index 27a6f34951d..079559cd674 100644 --- a/script/scaffold/templates/config_flow_oauth2/tests/test_config_flow.py +++ b/script/scaffold/templates/config_flow_oauth2/tests/test_config_flow.py @@ -6,6 +6,7 @@ import pytest from homeassistant import config_entries from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -25,7 +26,7 @@ CLIENT_SECRET = "5678" @pytest.fixture async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/aladdin_connect/conftest.py b/tests/components/aladdin_connect/conftest.py index bd6f58c98b7..1843ba9db28 100644 --- a/tests/components/aladdin_connect/conftest.py +++ b/tests/components/aladdin_connect/conftest.py @@ -4,6 +4,7 @@ import pytest from homeassistant.components.aladdin_connect import DOMAIN from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -18,7 +19,7 @@ from tests.common import MockConfigEntry @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/application_credentials/test_init.py b/tests/components/application_credentials/test_init.py index 9896e4c9fc0..6b0128d3f32 100644 --- a/tests/components/application_credentials/test_init.py +++ b/tests/components/application_credentials/test_init.py @@ -93,7 +93,7 @@ async def mock_application_credentials_integration( ): """Mock a application_credentials integration.""" with patch("homeassistant.loader.APPLICATION_CREDENTIALS", [TEST_DOMAIN]): - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, DOMAIN, {}) await setup_application_credentials_integration( hass, TEST_DOMAIN, authorization_server ) @@ -629,7 +629,7 @@ async def test_websocket_without_platform( hass: HomeAssistant, ws_client: ClientFixture ) -> None: """Test an integration without the application credential platform.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, DOMAIN, {}) hass.config.components.add(TEST_DOMAIN) client = await ws_client() @@ -658,7 +658,7 @@ async def test_websocket_without_authorization_server( hass: HomeAssistant, ws_client: ClientFixture ) -> None: """Test platform with incorrect implementation.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, DOMAIN, {}) hass.config.components.add(TEST_DOMAIN) # Platform does not implemenent async_get_authorization_server @@ -703,7 +703,7 @@ async def test_platform_with_auth_implementation( ) -> None: """Test config flow with custom OAuth2 implementation.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, DOMAIN, {}) hass.config.components.add(TEST_DOMAIN) async def get_auth_impl( diff --git a/tests/components/august/conftest.py b/tests/components/august/conftest.py index 54f25a7a63b..9b4933845d7 100644 --- a/tests/components/august/conftest.py +++ b/tests/components/august/conftest.py @@ -6,6 +6,7 @@ import pytest from yalexs.manager.ratelimit import _RateLimitChecker from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -106,7 +107,7 @@ def load_reauth_jwt_wrong_account_fixture() -> str: @pytest.fixture(name="client_credentials", autouse=True) async def mock_client_credentials_fixture(hass: HomeAssistant) -> None: """Mock client credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/august/mocks.py b/tests/components/august/mocks.py index 50d8d59082f..3eddebb2a42 100644 --- a/tests/components/august/mocks.py +++ b/tests/components/august/mocks.py @@ -36,6 +36,7 @@ from yalexs.manager.ratelimit import _RateLimitChecker from yalexs.pubnub_async import AugustPubNub from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -106,7 +107,7 @@ def mock_config_entry(jwt: str | None = None) -> MockConfigEntry: async def mock_client_credentials(hass: HomeAssistant) -> ClientCredential: """Mock client credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/ekeybionyx/test_config_flow.py b/tests/components/ekeybionyx/test_config_flow.py index f50cd099dbc..4f5196ef6b2 100644 --- a/tests/components/ekeybionyx/test_config_flow.py +++ b/tests/components/ekeybionyx/test_config_flow.py @@ -6,6 +6,7 @@ import pytest from homeassistant import config_entries from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -32,7 +33,7 @@ CLIENT_SECRET = "5678" @pytest.fixture async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/electric_kiwi/conftest.py b/tests/components/electric_kiwi/conftest.py index cc967631be4..945c8abc7f3 100644 --- a/tests/components/electric_kiwi/conftest.py +++ b/tests/components/electric_kiwi/conftest.py @@ -17,6 +17,7 @@ from electrickiwi_api.model import ( import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -34,7 +35,7 @@ REDIRECT_URI = "https://example.com/auth/external/callback" @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup application credentials component.""" - await async_setup_component(hass, "application_credentials", {}) + await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/fitbit/conftest.py b/tests/components/fitbit/conftest.py index 3f38a9614fb..4740714e08e 100644 --- a/tests/components/fitbit/conftest.py +++ b/tests/components/fitbit/conftest.py @@ -11,6 +11,7 @@ import pytest from requests_mock.mocker import Mocker from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -98,7 +99,7 @@ def mock_config_entry( @pytest.fixture async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/geocaching/test_config_flow.py b/tests/components/geocaching/test_config_flow.py index 5db89de0868..0f2ebfa7087 100644 --- a/tests/components/geocaching/test_config_flow.py +++ b/tests/components/geocaching/test_config_flow.py @@ -6,6 +6,7 @@ from unittest.mock import MagicMock import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -32,7 +33,7 @@ CURRENT_ENVIRONMENT_URLS = ENVIRONMENT_URLS[ENVIRONMENT] @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/google/conftest.py b/tests/components/google/conftest.py index 23b6b884145..a75eb9edcda 100644 --- a/tests/components/google/conftest.py +++ b/tests/components/google/conftest.py @@ -16,6 +16,7 @@ import pytest import yaml from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -353,7 +354,7 @@ def component_setup( """Fixture for setting up the integration.""" async def _setup_func() -> bool: - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/google/test_config_flow.py b/tests/components/google/test_config_flow.py index e5f4e512579..adaa146cf51 100644 --- a/tests/components/google/test_config_flow.py +++ b/tests/components/google/test_config_flow.py @@ -22,6 +22,7 @@ import pytest from homeassistant import config_entries from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -59,7 +60,7 @@ async def request_setup(current_request_with_host: None) -> None: @pytest.fixture(autouse=True) async def setup_app_creds(hass: HomeAssistant) -> None: """Fixture to setup application credentials component.""" - await async_setup_component(hass, "application_credentials", {}) + await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) @pytest.fixture diff --git a/tests/components/google_assistant_sdk/conftest.py b/tests/components/google_assistant_sdk/conftest.py index 50aa1e9249b..dbeeb829569 100644 --- a/tests/components/google_assistant_sdk/conftest.py +++ b/tests/components/google_assistant_sdk/conftest.py @@ -8,6 +8,7 @@ from google.oauth2.credentials import Credentials import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -27,7 +28,7 @@ ACCESS_TOKEN = "mock-access-token" @pytest.fixture async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/google_drive/conftest.py b/tests/components/google_drive/conftest.py index 9e99e0fdd3a..795bb6d5292 100644 --- a/tests/components/google_drive/conftest.py +++ b/tests/components/google_drive/conftest.py @@ -7,6 +7,7 @@ from unittest.mock import AsyncMock, MagicMock, patch import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -30,7 +31,7 @@ CONFIG_ENTRY_TITLE = "Google Drive entry title" @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/google_mail/conftest.py b/tests/components/google_mail/conftest.py index 3336d905bc1..55b7076c273 100644 --- a/tests/components/google_mail/conftest.py +++ b/tests/components/google_mail/conftest.py @@ -9,6 +9,7 @@ from httplib2 import Response import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -44,7 +45,7 @@ def mock_scopes() -> list[str]: @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, @@ -99,7 +100,7 @@ async def mock_setup_integration( """Fixture for setting up the component.""" config_entry.add_to_hass(hass) - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/google_photos/conftest.py b/tests/components/google_photos/conftest.py index 93837f2a2e7..dd86321c34f 100644 --- a/tests/components/google_photos/conftest.py +++ b/tests/components/google_photos/conftest.py @@ -16,6 +16,7 @@ from google_photos_library_api.model import ( import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -94,7 +95,7 @@ def mock_config_entry( @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/google_sheets/test_config_flow.py b/tests/components/google_sheets/test_config_flow.py index 756ff080212..5904dc283f1 100644 --- a/tests/components/google_sheets/test_config_flow.py +++ b/tests/components/google_sheets/test_config_flow.py @@ -8,6 +8,7 @@ import pytest from homeassistant import config_entries from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -32,7 +33,7 @@ TITLE = "Google Sheets" @pytest.fixture async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/google_sheets/test_init.py b/tests/components/google_sheets/test_init.py index afe12688872..e3fa4842f19 100644 --- a/tests/components/google_sheets/test_init.py +++ b/tests/components/google_sheets/test_init.py @@ -13,6 +13,7 @@ from requests.models import Response from syrupy.assertion import SnapshotAssertion from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -76,7 +77,7 @@ async def mock_setup_integration( """Fixture for setting up the component.""" config_entry.add_to_hass(hass) - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/google_tasks/conftest.py b/tests/components/google_tasks/conftest.py index 8f966800147..a168c868b2c 100644 --- a/tests/components/google_tasks/conftest.py +++ b/tests/components/google_tasks/conftest.py @@ -10,6 +10,7 @@ from httplib2 import Response import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -87,7 +88,7 @@ def mock_config_entry(token_entry: dict[str, Any]) -> MockConfigEntry: @pytest.fixture async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/home_connect/conftest.py b/tests/components/home_connect/conftest.py index 4442f9622de..8065ff551e2 100644 --- a/tests/components/home_connect/conftest.py +++ b/tests/components/home_connect/conftest.py @@ -32,6 +32,7 @@ from aiohomeconnect.model.program import EnumerateProgram import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -123,7 +124,7 @@ def mock_config_entry_v1_2(token_entry: dict[str, Any]) -> MockConfigEntry: @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/husqvarna_automower/conftest.py b/tests/components/husqvarna_automower/conftest.py index 02b9b2715a1..cd508d697a3 100644 --- a/tests/components/husqvarna_automower/conftest.py +++ b/tests/components/husqvarna_automower/conftest.py @@ -12,6 +12,7 @@ from aiohttp import ClientWebSocketResponse import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -95,7 +96,7 @@ def mock_config_entry(jwt: str, expires_at: int, scope: str) -> MockConfigEntry: @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/iotty/test_config_flow.py b/tests/components/iotty/test_config_flow.py index 4fe32fd133c..98bfa4d1842 100644 --- a/tests/components/iotty/test_config_flow.py +++ b/tests/components/iotty/test_config_flow.py @@ -8,6 +8,7 @@ import pytest from homeassistant import config_entries from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -27,7 +28,7 @@ from tests.typing import ClientSessionGenerator @pytest.fixture async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup application credentials component.""" - await async_setup_component(hass, "application_credentials", {}) + await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/lametric/conftest.py b/tests/components/lametric/conftest.py index f8837054691..017c7dc4857 100644 --- a/tests/components/lametric/conftest.py +++ b/tests/components/lametric/conftest.py @@ -10,6 +10,7 @@ from demetriek import CloudDevice, Device import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -24,7 +25,7 @@ from tests.common import MockConfigEntry, load_fixture, load_json_array_fixture @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, ClientCredential("client", "secret"), "credentials" ) diff --git a/tests/components/mcp/conftest.py b/tests/components/mcp/conftest.py index 48700ce007a..d8c80f1ab43 100644 --- a/tests/components/mcp/conftest.py +++ b/tests/components/mcp/conftest.py @@ -8,6 +8,7 @@ from unittest.mock import AsyncMock, patch import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -92,7 +93,7 @@ def mock_config_entry(hass: HomeAssistant) -> MockConfigEntry: @pytest.fixture(name="credential") async def mock_credential(hass: HomeAssistant) -> None: """Fixture that provides the ClientCredential for the test.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/microbees/conftest.py b/tests/components/microbees/conftest.py index 6c2c45232da..0a24010da54 100644 --- a/tests/components/microbees/conftest.py +++ b/tests/components/microbees/conftest.py @@ -7,6 +7,7 @@ from microBeesPy import Bee, MicroBees, Profile import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -38,7 +39,7 @@ def mock_scopes() -> list[str]: @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/miele/conftest.py b/tests/components/miele/conftest.py index d7ac1f5d69b..274cd483326 100644 --- a/tests/components/miele/conftest.py +++ b/tests/components/miele/conftest.py @@ -8,6 +8,7 @@ from unittest.mock import AsyncMock, MagicMock, patch import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -58,7 +59,7 @@ def mock_config_entry(hass: HomeAssistant, expires_at: float) -> MockConfigEntry @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/monzo/conftest.py b/tests/components/monzo/conftest.py index 451fd6b409d..ed3e647f6e8 100644 --- a/tests/components/monzo/conftest.py +++ b/tests/components/monzo/conftest.py @@ -7,6 +7,7 @@ from monzopy.monzopy import UserAccount import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -50,7 +51,7 @@ USER_ID = 12345 @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/myuplink/conftest.py b/tests/components/myuplink/conftest.py index 3ab186b61a8..55251d44f1e 100644 --- a/tests/components/myuplink/conftest.py +++ b/tests/components/myuplink/conftest.py @@ -10,6 +10,7 @@ import orjson import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -58,7 +59,7 @@ def mock_config_entry(hass: HomeAssistant, expires_at: float) -> MockConfigEntry @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/nest/conftest.py b/tests/components/nest/conftest.py index deb463c905d..394d1f22c56 100644 --- a/tests/components/nest/conftest.py +++ b/tests/components/nest/conftest.py @@ -18,6 +18,7 @@ import pytest from yarl import URL from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, async_import_client_credential, ) from homeassistant.components.nest import DOMAIN @@ -291,7 +292,7 @@ async def credential(hass: HomeAssistant, nest_test_config: NestTestConfig) -> N """Fixture that provides the ClientCredential for the test if any.""" if not nest_test_config.credential: return - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, nest_test_config.credential, "imported-cred" ) diff --git a/tests/components/netatmo/conftest.py b/tests/components/netatmo/conftest.py index 5bc3676c69d..d9d63820cc5 100644 --- a/tests/components/netatmo/conftest.py +++ b/tests/components/netatmo/conftest.py @@ -9,6 +9,7 @@ from pyatmo.const import ALL_SCOPES import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -27,7 +28,7 @@ CLIENT_SECRET = "5678" @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/onedrive/conftest.py b/tests/components/onedrive/conftest.py index 40b61d5412a..c5d93b81da8 100644 --- a/tests/components/onedrive/conftest.py +++ b/tests/components/onedrive/conftest.py @@ -20,6 +20,7 @@ from onedrive_personal_sdk.models.items import ( import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -46,7 +47,7 @@ def mock_scopes() -> list[str]: @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/point/test_config_flow.py b/tests/components/point/test_config_flow.py index 4de1c9a4583..0583e015363 100644 --- a/tests/components/point/test_config_flow.py +++ b/tests/components/point/test_config_flow.py @@ -6,6 +6,7 @@ import pytest from homeassistant import config_entries from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -28,7 +29,7 @@ REDIRECT_URL = "https://example.com/auth/external/callback" @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/senz/conftest.py b/tests/components/senz/conftest.py index be0bd6e3226..07850a0cee0 100644 --- a/tests/components/senz/conftest.py +++ b/tests/components/senz/conftest.py @@ -9,6 +9,7 @@ from pysenz import Account, Thermostat import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -101,7 +102,7 @@ def mock_senz_client(account_fixture, device_fixture) -> Generator[MagicMock]: @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/smartthings/conftest.py b/tests/components/smartthings/conftest.py index c49e7116acb..4bd35611b2e 100644 --- a/tests/components/smartthings/conftest.py +++ b/tests/components/smartthings/conftest.py @@ -18,6 +18,7 @@ from pysmartthings.models import HealthStatus, InstalledApp import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -54,7 +55,7 @@ def mock_expires_at() -> int: @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/spotify/conftest.py b/tests/components/spotify/conftest.py index 9efc453f855..498012de09e 100644 --- a/tests/components/spotify/conftest.py +++ b/tests/components/spotify/conftest.py @@ -27,6 +27,7 @@ from spotifyaio.models import ( ) from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -70,7 +71,7 @@ def mock_config_entry(expires_at: int) -> MockConfigEntry: @pytest.fixture async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/tesla_fleet/__init__.py b/tests/components/tesla_fleet/__init__.py index a43ec14fc51..48cd368bc6b 100644 --- a/tests/components/tesla_fleet/__init__.py +++ b/tests/components/tesla_fleet/__init__.py @@ -5,6 +5,7 @@ from unittest.mock import patch from syrupy.assertion import SnapshotAssertion from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -24,7 +25,7 @@ async def setup_platform( ) -> None: """Set up the Tesla Fleet platform.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/tesla_fleet/test_config_flow.py b/tests/components/tesla_fleet/test_config_flow.py index 7b616151f6b..1da4911f733 100644 --- a/tests/components/tesla_fleet/test_config_flow.py +++ b/tests/components/tesla_fleet/test_config_flow.py @@ -11,6 +11,7 @@ from tesla_fleet_api.exceptions import ( ) from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -62,7 +63,7 @@ async def access_token(hass: HomeAssistant) -> str: async def create_credential(hass: HomeAssistant) -> None: """Create a user credential.""" # Create user application credential - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/tibber/conftest.py b/tests/components/tibber/conftest.py index cbd5ece648a..9aee6b097b4 100644 --- a/tests/components/tibber/conftest.py +++ b/tests/components/tibber/conftest.py @@ -9,6 +9,7 @@ import pytest import tibber from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -216,7 +217,7 @@ async def mock_tibber_setup( @pytest.fixture async def setup_credentials(hass: HomeAssistant) -> None: """Set up application credentials for the OAuth flow.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/twitch/conftest.py b/tests/components/twitch/conftest.py index bc48bb4bd44..1b2738865af 100644 --- a/tests/components/twitch/conftest.py +++ b/tests/components/twitch/conftest.py @@ -8,6 +8,7 @@ import pytest from twitchAPI.object.api import FollowedChannel, Stream, TwitchUser, UserSubscription from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -43,7 +44,7 @@ def mock_scopes() -> list[str]: @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/volvo/conftest.py b/tests/components/volvo/conftest.py index 4a4d9350a36..1163075f285 100644 --- a/tests/components/volvo/conftest.py +++ b/tests/components/volvo/conftest.py @@ -17,6 +17,7 @@ from volvocarsapi.models import ( ) from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -163,7 +164,7 @@ async def mock_api( @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/watts/conftest.py b/tests/components/watts/conftest.py index cf44e90db26..5617c13ca32 100644 --- a/tests/components/watts/conftest.py +++ b/tests/components/watts/conftest.py @@ -7,6 +7,7 @@ import pytest from visionpluspython.models import Device, create_device_from_data from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -33,7 +34,7 @@ TEST_EXPIRES_AT = 9999999999 @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Ensure the application credentials are registered for each test.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, diff --git a/tests/components/withings/conftest.py b/tests/components/withings/conftest.py index 5b73240908a..063e69f1890 100644 --- a/tests/components/withings/conftest.py +++ b/tests/components/withings/conftest.py @@ -9,6 +9,7 @@ from aiowithings.models import NotificationConfiguration import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -48,7 +49,7 @@ def mock_scopes() -> list[str]: @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/xbox/conftest.py b/tests/components/xbox/conftest.py index 5f665aab36a..9d8d1e18968 100644 --- a/tests/components/xbox/conftest.py +++ b/tests/components/xbox/conftest.py @@ -17,6 +17,7 @@ from pythonxbox.api.provider.smartglass.models import ( from pythonxbox.api.provider.titlehub.models import TitleHubResponse from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -34,7 +35,7 @@ CLIENT_SECRET = "5678" @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, ClientCredential(CLIENT_ID, CLIENT_SECRET), "cloud" ) diff --git a/tests/components/yale/mocks.py b/tests/components/yale/mocks.py index 098b29ca652..b6da067c694 100644 --- a/tests/components/yale/mocks.py +++ b/tests/components/yale/mocks.py @@ -36,6 +36,7 @@ from yalexs.manager.ratelimit import _RateLimitChecker from yalexs.manager.socketio import SocketIORunner from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -120,7 +121,7 @@ def mock_config_entry(jwt: str | None = None) -> MockConfigEntry: async def mock_client_credentials(hass: HomeAssistant) -> ClientCredential: """Mock client credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/yolink/conftest.py b/tests/components/yolink/conftest.py index 2090cd57f2f..9ff24bed0ed 100644 --- a/tests/components/yolink/conftest.py +++ b/tests/components/yolink/conftest.py @@ -9,6 +9,7 @@ import pytest from yolink.home_manager import YoLinkHome from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -26,7 +27,7 @@ DOMAIN = "yolink" @pytest.fixture async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, diff --git a/tests/components/youtube/conftest.py b/tests/components/youtube/conftest.py index 7cc9bd2435b..d197133205c 100644 --- a/tests/components/youtube/conftest.py +++ b/tests/components/youtube/conftest.py @@ -8,6 +8,7 @@ from unittest.mock import patch import pytest from homeassistant.components.application_credentials import ( + DOMAIN as APPLICATION_CREDENTIALS_DOMAIN, ClientCredential, async_import_client_credential, ) @@ -42,7 +43,7 @@ def mock_scopes() -> list[str]: @pytest.fixture(autouse=True) async def setup_credentials(hass: HomeAssistant) -> None: """Fixture to setup credentials.""" - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN, @@ -98,7 +99,7 @@ async def mock_setup_integration( """Fixture for setting up the component.""" config_entry.add_to_hass(hass) - assert await async_setup_component(hass, "application_credentials", {}) + assert await async_setup_component(hass, APPLICATION_CREDENTIALS_DOMAIN, {}) await async_import_client_credential( hass, DOMAIN,