mirror of
https://github.com/home-assistant/core.git
synced 2025-06-15 18:47:05 +00:00
Fix dangerous-default-value warnings in auth tests (#119597)
This commit is contained in:
parent
2a061f58eb
commit
349ac54616
@ -4,6 +4,7 @@ from typing import Any
|
|||||||
|
|
||||||
from homeassistant import auth
|
from homeassistant import auth
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers.typing import UNDEFINED, UndefinedType
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from tests.common import ensure_auth_manager_loaded
|
from tests.common import ensure_auth_manager_loaded
|
||||||
@ -26,14 +27,16 @@ EMPTY_CONFIG = []
|
|||||||
async def async_setup_auth(
|
async def async_setup_auth(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
aiohttp_client: ClientSessionGenerator,
|
aiohttp_client: ClientSessionGenerator,
|
||||||
provider_configs: list[dict[str, Any]] = BASE_CONFIG,
|
provider_configs: list[dict[str, Any]] | UndefinedType = UNDEFINED,
|
||||||
module_configs=EMPTY_CONFIG,
|
module_configs: list[dict[str, Any]] | UndefinedType = UNDEFINED,
|
||||||
setup_api: bool = False,
|
setup_api: bool = False,
|
||||||
custom_ip: str | None = None,
|
custom_ip: str | None = None,
|
||||||
):
|
):
|
||||||
"""Set up authentication and create an HTTP client."""
|
"""Set up authentication and create an HTTP client."""
|
||||||
hass.auth = await auth.auth_manager_from_config(
|
hass.auth = await auth.auth_manager_from_config(
|
||||||
hass, provider_configs, module_configs
|
hass,
|
||||||
|
BASE_CONFIG if provider_configs is UNDEFINED else provider_configs,
|
||||||
|
EMPTY_CONFIG if module_configs is UNDEFINED else module_configs,
|
||||||
)
|
)
|
||||||
ensure_auth_manager_loaded(hass.auth)
|
ensure_auth_manager_loaded(hass.auth)
|
||||||
await async_setup_component(hass, "auth", {})
|
await async_setup_component(hass, "auth", {})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user