From 403db6277fce9332e5978e9de74af040bbc94fb2 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 22 Aug 2024 14:50:45 +0200 Subject: [PATCH] Improve type hints in lcn tests (#124415) --- tests/components/lcn/test_config_flow.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/components/lcn/test_config_flow.py b/tests/components/lcn/test_config_flow.py index e4cb4c588e9..d002c5fe625 100644 --- a/tests/components/lcn/test_config_flow.py +++ b/tests/components/lcn/test_config_flow.py @@ -129,7 +129,7 @@ async def test_show_form(hass: HomeAssistant) -> None: assert result["step_id"] == "user" -async def test_step_user(hass): +async def test_step_user(hass: HomeAssistant) -> None: """Test for user step.""" with ( patch("pypck.connection.PchkConnectionManager.async_connect"), @@ -150,7 +150,9 @@ async def test_step_user(hass): } -async def test_step_user_existing_host(hass, entry): +async def test_step_user_existing_host( + hass: HomeAssistant, entry: MockConfigEntry +) -> None: """Test for user defined host already exists.""" entry.add_to_hass(hass) @@ -172,7 +174,9 @@ async def test_step_user_existing_host(hass, entry): (TimeoutError, {CONF_BASE: "connection_refused"}), ], ) -async def test_step_user_error(hass, error, errors): +async def test_step_user_error( + hass: HomeAssistant, error: type[Exception], errors: dict[str, str] +) -> None: """Test for error in user step is handled correctly.""" with patch( "pypck.connection.PchkConnectionManager.async_connect", side_effect=error @@ -187,7 +191,7 @@ async def test_step_user_error(hass, error, errors): assert result["errors"] == errors -async def test_step_reconfigure(hass, entry): +async def test_step_reconfigure(hass: HomeAssistant, entry: MockConfigEntry) -> None: """Test for reconfigure step.""" entry.add_to_hass(hass) old_entry_data = entry.data.copy() @@ -222,7 +226,12 @@ async def test_step_reconfigure(hass, entry): (TimeoutError, {CONF_BASE: "connection_refused"}), ], ) -async def test_step_reconfigure_error(hass, entry, error, errors): +async def test_step_reconfigure_error( + hass: HomeAssistant, + entry: MockConfigEntry, + error: type[Exception], + errors: dict[str, str], +) -> None: """Test for error in reconfigure step is handled correctly.""" entry.add_to_hass(hass) with patch( @@ -242,7 +251,7 @@ async def test_step_reconfigure_error(hass, entry, error, errors): assert result["errors"] == errors -async def test_validate_connection(): +async def test_validate_connection() -> None: """Test the connection validation.""" data = CONNECTION_DATA.copy()