Google Assistant SDK: use setup_credentials in setup_integration (#153793)

This commit is contained in:
tronikos
2025-10-06 01:23:44 -07:00
committed by GitHub
parent 6d97355b42
commit 85506ac78a
2 changed files with 6 additions and 12 deletions

View File

@@ -66,19 +66,13 @@ def mock_config_entry(expires_at: int, scopes: list[str]) -> MockConfigEntry:
@pytest.fixture(name="setup_integration")
async def mock_setup_integration(
hass: HomeAssistant, config_entry: MockConfigEntry
hass: HomeAssistant,
config_entry: MockConfigEntry,
setup_credentials: None,
) -> Callable[[], Coroutine[Any, Any, None]]:
"""Fixture for setting up the component."""
config_entry.add_to_hass(hass)
assert await async_setup_component(hass, "application_credentials", {})
await async_import_client_credential(
hass,
DOMAIN,
ClientCredential("client-id", "client-secret"),
DOMAIN,
)
async def func() -> None:
assert await async_setup_component(hass, DOMAIN, {})
await hass.async_block_till_done()

View File

@@ -26,7 +26,7 @@ async def test_full_flow(
hass: HomeAssistant,
hass_client_no_auth: ClientSessionGenerator,
aioclient_mock: AiohttpClientMocker,
setup_credentials,
setup_credentials: None,
) -> None:
"""Check full flow."""
result = await hass.config_entries.flow.async_init(
@@ -87,7 +87,7 @@ async def test_reauth(
hass: HomeAssistant,
hass_client_no_auth: ClientSessionGenerator,
aioclient_mock: AiohttpClientMocker,
setup_credentials,
setup_credentials: None,
) -> None:
"""Test the reauthentication case updates the existing config entry."""
@@ -162,7 +162,7 @@ async def test_single_instance_allowed(
hass: HomeAssistant,
hass_client_no_auth: ClientSessionGenerator,
aioclient_mock: AiohttpClientMocker,
setup_credentials,
setup_credentials: None,
) -> None:
"""Test case where config flow allows a single test."""
config_entry = MockConfigEntry(