From f77e4b24e643c944c01f9eb14eba9f17ce297e83 Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Wed, 31 Jan 2024 13:15:26 +0100 Subject: [PATCH] Code quality for Vodafone tests (#109078) vodafone pylance fixes --- tests/components/vodafone_station/test_config_flow.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/components/vodafone_station/test_config_flow.py b/tests/components/vodafone_station/test_config_flow.py index c04b8364f93..a50bde8de64 100644 --- a/tests/components/vodafone_station/test_config_flow.py +++ b/tests/components/vodafone_station/test_config_flow.py @@ -61,8 +61,8 @@ async def test_exception_connection(hass: HomeAssistant, side_effect, error) -> result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert result["type"] == FlowResultType.FORM - assert result["step_id"] == "user" + assert result.get("type") == FlowResultType.FORM + assert result.get("step_id") == "user" with patch( "aiovodafone.api.VodafoneStationSercommApi.login", @@ -74,6 +74,7 @@ async def test_exception_connection(hass: HomeAssistant, side_effect, error) -> assert result["type"] == FlowResultType.FORM assert result["step_id"] == "user" + assert result["errors"] is not None assert result["errors"]["base"] == error # Should be recoverable after hits error @@ -184,6 +185,7 @@ async def test_reauth_not_successful(hass: HomeAssistant, side_effect, error) -> assert result["type"] == FlowResultType.FORM assert result["step_id"] == "reauth_confirm" + assert result["errors"] is not None assert result["errors"]["base"] == error # Should be recoverable after hits error