From 83d25a402ff2e47e6e15ed5a9e310c3befbd9976 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 30 Aug 2026 12:18:20 +0200 Subject: [PATCH] Split the Last.fm user flow init from its data (#180739) --- tests/components/lastfm/test_config_flow.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/components/lastfm/test_config_flow.py b/tests/components/lastfm/test_config_flow.py index d49421b04e50..f97c46f6cd96 100644 --- a/tests/components/lastfm/test_config_flow.py +++ b/tests/components/lastfm/test_config_flow.py @@ -76,7 +76,15 @@ async def test_flow_fails( """Test user initialized flow with invalid username.""" with patch("pylast.User", return_value=MockUser(thrown_error=error)): result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": SOURCE_USER}, data=CONF_USER_DATA + DOMAIN, context={"source": SOURCE_USER} + ) + + assert result["type"] is FlowResultType.FORM + assert result["step_id"] == "user" + + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + user_input=CONF_USER_DATA, ) assert result["type"] is FlowResultType.FORM assert result["step_id"] == "user" @@ -112,7 +120,15 @@ async def test_flow_hidden_recent_tracks( ), ): result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": SOURCE_USER}, data=CONF_USER_DATA + DOMAIN, context={"source": SOURCE_USER} + ) + + assert result["type"] is FlowResultType.FORM + assert result["step_id"] == "user" + + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + user_input=CONF_USER_DATA, ) assert result["type"] is FlowResultType.FORM assert result["step_id"] == "user"