diff --git a/custom_components/nws_alerts/config_flow.py b/custom_components/nws_alerts/config_flow.py index 3c4a1eb..872c8cc 100644 --- a/custom_components/nws_alerts/config_flow.py +++ b/custom_components/nws_alerts/config_flow.py @@ -49,7 +49,7 @@ def _get_default(key): ) -async def _get_zone_list(self): +async def _get_zone_list(self) -> list | None: """Return list of zone by lat/lon""" data = None diff --git a/tests/test_config_flow.py b/tests/test_config_flow.py index a901eff..3dda612 100644 --- a/tests/test_config_flow.py +++ b/tests/test_config_flow.py @@ -39,17 +39,23 @@ async def test_form( ): """Test we get the form.""" await setup.async_setup_component(hass, "persistent_notification", {}) - result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER} - ) - assert result["type"] == "form" - assert result["errors"] == {} - # assert result["title"] == title_1 + with patch( + "custom_components.nws_alerts.config_flow._get_zone_list", + return_value=None): + + result = await hass.config_entries.flow.async_init( + DOMAIN, context={"source": config_entries.SOURCE_USER} + ) + assert result["type"] == "form" + assert result["errors"] == {} + # assert result["title"] == title_1 with patch( "custom_components.nws_alerts.async_setup_entry", return_value=True, - ) as mock_setup_entry: + ) as mock_setup_entry, patch( + "custom_components.nws_alerts.config_flow._get_zone_list", + return_value=None): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], input