mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 10:29:27 +00:00
Improve type hints in config tests (#120346)
This commit is contained in:
@@ -31,7 +31,9 @@ async def setup_script(hass: HomeAssistant, script_config: dict[str, Any]) -> No
|
||||
|
||||
@pytest.mark.parametrize("script_config", [{}])
|
||||
async def test_get_script_config(
|
||||
hass: HomeAssistant, hass_client: ClientSessionGenerator, hass_config_store
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
hass_config_store: dict[str, Any],
|
||||
) -> None:
|
||||
"""Test getting script config."""
|
||||
with patch.object(config, "SECTIONS", [script]):
|
||||
@@ -54,7 +56,9 @@ async def test_get_script_config(
|
||||
|
||||
@pytest.mark.parametrize("script_config", [{}])
|
||||
async def test_update_script_config(
|
||||
hass: HomeAssistant, hass_client: ClientSessionGenerator, hass_config_store
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
hass_config_store: dict[str, Any],
|
||||
) -> None:
|
||||
"""Test updating script config."""
|
||||
with patch.object(config, "SECTIONS", [script]):
|
||||
@@ -90,7 +94,9 @@ async def test_update_script_config(
|
||||
|
||||
@pytest.mark.parametrize("script_config", [{}])
|
||||
async def test_invalid_object_id(
|
||||
hass: HomeAssistant, hass_client: ClientSessionGenerator, hass_config_store
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
hass_config_store: dict[str, Any],
|
||||
) -> None:
|
||||
"""Test creating a script with an invalid object_id."""
|
||||
with patch.object(config, "SECTIONS", [script]):
|
||||
@@ -152,7 +158,7 @@ async def test_invalid_object_id(
|
||||
async def test_update_script_config_with_error(
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
hass_config_store,
|
||||
hass_config_store: dict[str, Any],
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
updated_config: Any,
|
||||
validation_error: str,
|
||||
@@ -202,8 +208,7 @@ async def test_update_script_config_with_error(
|
||||
async def test_update_script_config_with_blueprint_substitution_error(
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
hass_config_store,
|
||||
# setup_automation,
|
||||
hass_config_store: dict[str, Any],
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
updated_config: Any,
|
||||
validation_error: str,
|
||||
@@ -239,7 +244,9 @@ async def test_update_script_config_with_blueprint_substitution_error(
|
||||
|
||||
@pytest.mark.parametrize("script_config", [{}])
|
||||
async def test_update_remove_key_script_config(
|
||||
hass: HomeAssistant, hass_client: ClientSessionGenerator, hass_config_store
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
hass_config_store: dict[str, Any],
|
||||
) -> None:
|
||||
"""Test updating script config while removing a key."""
|
||||
with patch.object(config, "SECTIONS", [script]):
|
||||
@@ -286,7 +293,7 @@ async def test_delete_script(
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
entity_registry: er.EntityRegistry,
|
||||
hass_config_store,
|
||||
hass_config_store: dict[str, Any],
|
||||
) -> None:
|
||||
"""Test deleting a script."""
|
||||
with patch.object(config, "SECTIONS", [script]):
|
||||
@@ -325,7 +332,7 @@ async def test_api_calls_require_admin(
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
hass_read_only_access_token: str,
|
||||
hass_config_store,
|
||||
hass_config_store: dict[str, Any],
|
||||
) -> None:
|
||||
"""Test script APIs endpoints do not work as a normal user."""
|
||||
with patch.object(config, "SECTIONS", [script]):
|
||||
|
||||
Reference in New Issue
Block a user