From 7b3a932cd94ebbdc245b2186029636864f22a6e5 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 11 Apr 2023 10:00:17 +0200 Subject: [PATCH] Remove incorrect constant usage in test (#91198) --- tests/components/accuweather/test_config_flow.py | 2 +- tests/components/aemet/test_config_flow.py | 2 +- tests/components/airly/test_config_flow.py | 2 +- tests/components/airzone/test_config_flow.py | 4 ++-- tests/components/apcupsd/test_config_flow.py | 2 +- tests/components/awair/test_config_flow.py | 2 +- tests/components/axis/test_config_flow.py | 14 +++++++------- tests/components/balboa/test_config_flow.py | 3 +-- tests/components/braviatv/test_config_flow.py | 2 +- tests/components/brother/test_config_flow.py | 2 +- tests/components/bsblan/test_config_flow.py | 2 +- tests/components/cpuspeed/test_config_flow.py | 4 ++-- tests/components/easyenergy/test_config_flow.py | 2 +- tests/components/econet/test_config_flow.py | 8 ++++---- tests/components/elgato/test_config_flow.py | 2 +- tests/components/energyzero/test_config_flow.py | 2 +- .../components/forecast_solar/test_config_flow.py | 2 +- tests/components/forked_daapd/test_config_flow.py | 2 +- tests/components/freedompro/test_config_flow.py | 2 +- tests/components/fully_kiosk/test_config_flow.py | 4 ++-- tests/components/iss/test_config_flow.py | 2 +- .../components/launch_library/test_config_flow.py | 2 +- tests/components/luftdaten/test_config_flow.py | 12 ++++++------ tests/components/mjpeg/test_config_flow.py | 12 ++++++------ tests/components/moon/test_config_flow.py | 2 +- tests/components/nam/test_config_flow.py | 4 ++-- tests/components/nextdns/test_config_flow.py | 2 +- tests/components/open_meteo/test_config_flow.py | 2 +- .../components/openweathermap/test_config_flow.py | 2 +- tests/components/p1_monitor/test_config_flow.py | 2 +- tests/components/poolsense/test_config_flow.py | 2 +- tests/components/pure_energie/test_config_flow.py | 2 +- tests/components/pvoutput/test_config_flow.py | 6 +++--- tests/components/qnap_qsw/test_config_flow.py | 2 +- tests/components/rdw/test_config_flow.py | 6 +++--- tests/components/season/test_config_flow.py | 2 +- tests/components/stookalert/test_config_flow.py | 2 +- tests/components/stookwijzer/test_config_flow.py | 2 +- tests/components/sun/test_config_flow.py | 2 +- tests/components/tailscale/test_config_flow.py | 6 +++--- tests/components/tolo/test_config_flow.py | 6 +++--- tests/components/twentemilieu/test_config_flow.py | 8 ++++---- tests/components/unifi/test_config_flow.py | 4 ++-- tests/components/uptime/test_config_flow.py | 2 +- tests/components/venstar/test_config_flow.py | 3 +-- tests/components/whois/test_config_flow.py | 6 +++--- tests/components/youless/test_config_flows.py | 4 ++-- 47 files changed, 85 insertions(+), 87 deletions(-) diff --git a/tests/components/accuweather/test_config_flow.py b/tests/components/accuweather/test_config_flow.py index a6a9f9c04fc..4d8d83a2a2f 100644 --- a/tests/components/accuweather/test_config_flow.py +++ b/tests/components/accuweather/test_config_flow.py @@ -26,7 +26,7 @@ async def test_show_form(hass: HomeAssistant) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" async def test_api_key_too_short(hass: HomeAssistant) -> None: diff --git a/tests/components/aemet/test_config_flow.py b/tests/components/aemet/test_config_flow.py index 8ec16d313f7..59a6993903f 100644 --- a/tests/components/aemet/test_config_flow.py +++ b/tests/components/aemet/test_config_flow.py @@ -36,7 +36,7 @@ async def test_form(hass: HomeAssistant, mock_setup_entry: AsyncMock) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" assert result["errors"] == {} result = await hass.config_entries.flow.async_configure( diff --git a/tests/components/airly/test_config_flow.py b/tests/components/airly/test_config_flow.py index 8a9b8807a19..2abd9bd1204 100644 --- a/tests/components/airly/test_config_flow.py +++ b/tests/components/airly/test_config_flow.py @@ -29,7 +29,7 @@ async def test_show_form(hass: HomeAssistant) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" async def test_invalid_api_key( diff --git a/tests/components/airzone/test_config_flow.py b/tests/components/airzone/test_config_flow.py index 1501c9ba863..2d89d0b556e 100644 --- a/tests/components/airzone/test_config_flow.py +++ b/tests/components/airzone/test_config_flow.py @@ -54,7 +54,7 @@ async def test_form(hass: HomeAssistant) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" assert result["errors"] == {} result = await hass.config_entries.flow.async_configure( @@ -97,7 +97,7 @@ async def test_form_invalid_system_id(hass: HomeAssistant) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" assert result["errors"] == {CONF_ID: "invalid_system_id"} mock_hvac.return_value = HVAC_MOCK[API_SYSTEMS][0] diff --git a/tests/components/apcupsd/test_config_flow.py b/tests/components/apcupsd/test_config_flow.py index c8696c71941..a9ef4328e86 100644 --- a/tests/components/apcupsd/test_config_flow.py +++ b/tests/components/apcupsd/test_config_flow.py @@ -117,7 +117,7 @@ async def test_flow_works(hass: HomeAssistant) -> None: context={CONF_SOURCE: SOURCE_USER}, ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input=CONF_DATA diff --git a/tests/components/awair/test_config_flow.py b/tests/components/awair/test_config_flow.py index 5a1a83fa0fb..b9f466174af 100644 --- a/tests/components/awair/test_config_flow.py +++ b/tests/components/awair/test_config_flow.py @@ -29,7 +29,7 @@ async def test_show_form(hass: HomeAssistant) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.MENU - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" async def test_invalid_access_token(hass: HomeAssistant) -> None: diff --git a/tests/components/axis/test_config_flow.py b/tests/components/axis/test_config_flow.py index 2c5b3a50513..d535b4bcb1f 100644 --- a/tests/components/axis/test_config_flow.py +++ b/tests/components/axis/test_config_flow.py @@ -56,7 +56,7 @@ async def test_flow_manual_configuration( ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" result = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -91,7 +91,7 @@ async def test_manual_configuration_update_configuration( ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" mock_vapix_requests("2.3.4.5") result = await hass.config_entries.flow.async_configure( @@ -117,7 +117,7 @@ async def test_flow_fails_faulty_credentials(hass: HomeAssistant) -> None: ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" with patch( "homeassistant.components.axis.config_flow.get_axis_device", @@ -143,7 +143,7 @@ async def test_flow_fails_cannot_connect(hass: HomeAssistant) -> None: ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" with patch( "homeassistant.components.axis.config_flow.get_axis_device", @@ -182,7 +182,7 @@ async def test_flow_create_entry_multiple_existing_entries_of_same_model( ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" result = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -223,7 +223,7 @@ async def test_reauth_flow_update_configuration( ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" mock_vapix_requests("2.3.4.5") result = await hass.config_entries.flow.async_configure( @@ -321,7 +321,7 @@ async def test_discovery_flow( ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" flows = hass.config_entries.flow.async_progress() assert len(flows) == 1 diff --git a/tests/components/balboa/test_config_flow.py b/tests/components/balboa/test_config_flow.py index 44ead926e46..95c415b8909 100644 --- a/tests/components/balboa/test_config_flow.py +++ b/tests/components/balboa/test_config_flow.py @@ -5,7 +5,6 @@ from pybalboa.exceptions import SpaConnectionError from homeassistant import config_entries, data_entry_flow from homeassistant.components.balboa.const import CONF_SYNC_TIME, DOMAIN -from homeassistant.config_entries import SOURCE_USER from homeassistant.const import CONF_HOST from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import FlowResultType @@ -111,7 +110,7 @@ async def test_already_configured(hass: HomeAssistant, client: MagicMock) -> Non ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" with patch( "homeassistant.components.balboa.config_flow.SpaClient.__aenter__", diff --git a/tests/components/braviatv/test_config_flow.py b/tests/components/braviatv/test_config_flow.py index 3dffeaf527c..1ac1fcd4bea 100644 --- a/tests/components/braviatv/test_config_flow.py +++ b/tests/components/braviatv/test_config_flow.py @@ -94,7 +94,7 @@ async def test_show_form(hass: HomeAssistant) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" async def test_ssdp_discovery(hass: HomeAssistant) -> None: diff --git a/tests/components/brother/test_config_flow.py b/tests/components/brother/test_config_flow.py index 0e1db72ddae..629295e09e0 100644 --- a/tests/components/brother/test_config_flow.py +++ b/tests/components/brother/test_config_flow.py @@ -26,7 +26,7 @@ async def test_show_form(hass: HomeAssistant) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" async def test_create_entry_with_hostname(hass: HomeAssistant) -> None: diff --git a/tests/components/bsblan/test_config_flow.py b/tests/components/bsblan/test_config_flow.py index ab8d4237588..bcd6dec14b1 100644 --- a/tests/components/bsblan/test_config_flow.py +++ b/tests/components/bsblan/test_config_flow.py @@ -31,7 +31,7 @@ async def test_full_user_flow_implementation( ) assert result.get("type") == RESULT_TYPE_FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/cpuspeed/test_config_flow.py b/tests/components/cpuspeed/test_config_flow.py index 2d0f4c6df22..323eb80d712 100644 --- a/tests/components/cpuspeed/test_config_flow.py +++ b/tests/components/cpuspeed/test_config_flow.py @@ -21,7 +21,7 @@ async def test_full_user_flow( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -67,7 +67,7 @@ async def test_not_compatible( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" mock_cpuinfo_config_flow.return_value = {} result2 = await hass.config_entries.flow.async_configure( diff --git a/tests/components/easyenergy/test_config_flow.py b/tests/components/easyenergy/test_config_flow.py index 2ad9b762e83..30d4924db8c 100644 --- a/tests/components/easyenergy/test_config_flow.py +++ b/tests/components/easyenergy/test_config_flow.py @@ -17,7 +17,7 @@ async def test_full_user_flow( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( diff --git a/tests/components/econet/test_config_flow.py b/tests/components/econet/test_config_flow.py index 6048aea17c0..d01d6163285 100644 --- a/tests/components/econet/test_config_flow.py +++ b/tests/components/econet/test_config_flow.py @@ -20,7 +20,7 @@ async def test_bad_credentials(hass: HomeAssistant) -> None: DOMAIN, context={"source": SOURCE_USER} ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" with patch( "pyeconet.EcoNetApiInterface.login", @@ -50,7 +50,7 @@ async def test_generic_error_from_library(hass: HomeAssistant) -> None: DOMAIN, context={"source": SOURCE_USER} ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" with patch( "pyeconet.EcoNetApiInterface.login", @@ -80,7 +80,7 @@ async def test_auth_worked(hass: HomeAssistant) -> None: DOMAIN, context={"source": SOURCE_USER} ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" with patch( "pyeconet.EcoNetApiInterface.login", @@ -117,7 +117,7 @@ async def test_already_configured(hass: HomeAssistant) -> None: DOMAIN, context={"source": SOURCE_USER} ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" with patch( "pyeconet.EcoNetApiInterface.login", diff --git a/tests/components/elgato/test_config_flow.py b/tests/components/elgato/test_config_flow.py index 3447038b778..1b71a29632f 100644 --- a/tests/components/elgato/test_config_flow.py +++ b/tests/components/elgato/test_config_flow.py @@ -28,7 +28,7 @@ async def test_full_user_flow_implementation( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={CONF_HOST: "127.0.0.1", CONF_PORT: 9123} diff --git a/tests/components/energyzero/test_config_flow.py b/tests/components/energyzero/test_config_flow.py index c24eed9b259..5f7b4925036 100644 --- a/tests/components/energyzero/test_config_flow.py +++ b/tests/components/energyzero/test_config_flow.py @@ -20,7 +20,7 @@ async def test_full_user_flow( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( diff --git a/tests/components/forecast_solar/test_config_flow.py b/tests/components/forecast_solar/test_config_flow.py index 41cfb4d839e..2129821217e 100644 --- a/tests/components/forecast_solar/test_config_flow.py +++ b/tests/components/forecast_solar/test_config_flow.py @@ -24,7 +24,7 @@ async def test_user_flow(hass: HomeAssistant, mock_setup_entry: AsyncMock) -> No ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/forked_daapd/test_config_flow.py b/tests/components/forked_daapd/test_config_flow.py index fe442641e72..81357b6f3eb 100644 --- a/tests/components/forked_daapd/test_config_flow.py +++ b/tests/components/forked_daapd/test_config_flow.py @@ -60,7 +60,7 @@ async def test_show_form(hass: HomeAssistant) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" async def test_config_flow(hass: HomeAssistant, config_entry) -> None: diff --git a/tests/components/freedompro/test_config_flow.py b/tests/components/freedompro/test_config_flow.py index dc55ba037ba..cab8605d865 100644 --- a/tests/components/freedompro/test_config_flow.py +++ b/tests/components/freedompro/test_config_flow.py @@ -25,7 +25,7 @@ async def test_show_form(hass: HomeAssistant) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" async def test_invalid_auth(hass: HomeAssistant) -> None: diff --git a/tests/components/fully_kiosk/test_config_flow.py b/tests/components/fully_kiosk/test_config_flow.py index 5527cd367af..566f3b6d292 100644 --- a/tests/components/fully_kiosk/test_config_flow.py +++ b/tests/components/fully_kiosk/test_config_flow.py @@ -28,7 +28,7 @@ async def test_user_flow( DOMAIN, context={"source": SOURCE_USER} ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -117,7 +117,7 @@ async def test_duplicate_updates_existing_entry( DOMAIN, context={"source": SOURCE_USER} ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/iss/test_config_flow.py b/tests/components/iss/test_config_flow.py index f206f5d8580..fec4d9b192c 100644 --- a/tests/components/iss/test_config_flow.py +++ b/tests/components/iss/test_config_flow.py @@ -18,7 +18,7 @@ async def test_create_entry(hass: HomeAssistant) -> None: ) assert result.get("type") == data_entry_flow.FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" with patch("homeassistant.components.iss.async_setup_entry", return_value=True): result = await hass.config_entries.flow.async_configure( diff --git a/tests/components/launch_library/test_config_flow.py b/tests/components/launch_library/test_config_flow.py index ef88c4d1bb6..8a8a2a94937 100644 --- a/tests/components/launch_library/test_config_flow.py +++ b/tests/components/launch_library/test_config_flow.py @@ -17,7 +17,7 @@ async def test_create_entry(hass: HomeAssistant) -> None: ) assert result.get("type") == data_entry_flow.FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" with patch( "homeassistant.components.launch_library.async_setup_entry", return_value=True diff --git a/tests/components/luftdaten/test_config_flow.py b/tests/components/luftdaten/test_config_flow.py index d98e415482d..5197a101bfd 100644 --- a/tests/components/luftdaten/test_config_flow.py +++ b/tests/components/luftdaten/test_config_flow.py @@ -24,7 +24,7 @@ async def test_duplicate_error( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -44,7 +44,7 @@ async def test_communication_error( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" mock_luftdaten_config_flow.get_data.side_effect = LuftdatenConnectionError result2 = await hass.config_entries.flow.async_configure( @@ -53,7 +53,7 @@ async def test_communication_error( ) assert result2.get("type") == FlowResultType.FORM - assert result2.get("step_id") == SOURCE_USER + assert result2.get("step_id") == "user" assert result2.get("errors") == {CONF_SENSOR_ID: "cannot_connect"} mock_luftdaten_config_flow.get_data.side_effect = None @@ -79,7 +79,7 @@ async def test_invalid_sensor( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" mock_luftdaten_config_flow.validate_sensor.return_value = False result2 = await hass.config_entries.flow.async_configure( @@ -88,7 +88,7 @@ async def test_invalid_sensor( ) assert result2.get("type") == FlowResultType.FORM - assert result2.get("step_id") == SOURCE_USER + assert result2.get("step_id") == "user" assert result2.get("errors") == {CONF_SENSOR_ID: "invalid_sensor"} mock_luftdaten_config_flow.validate_sensor.return_value = True @@ -116,7 +116,7 @@ async def test_step_user( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/mjpeg/test_config_flow.py b/tests/components/mjpeg/test_config_flow.py index c95f4f1c40f..a60df88b789 100644 --- a/tests/components/mjpeg/test_config_flow.py +++ b/tests/components/mjpeg/test_config_flow.py @@ -36,7 +36,7 @@ async def test_full_user_flow( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -81,7 +81,7 @@ async def test_full_flow_with_authentication_error( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" mock_mjpeg_requests.get( "https://example.com/mjpeg", text="Access Denied!", status_code=401 @@ -97,7 +97,7 @@ async def test_full_flow_with_authentication_error( ) assert result2.get("type") == FlowResultType.FORM - assert result2.get("step_id") == SOURCE_USER + assert result2.get("step_id") == "user" assert result2.get("errors") == {"username": "invalid_auth"} assert len(mock_setup_entry.mock_calls) == 0 @@ -141,7 +141,7 @@ async def test_connection_error( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" # Test connectione error on MJPEG url mock_mjpeg_requests.get( @@ -157,7 +157,7 @@ async def test_connection_error( ) assert result2.get("type") == FlowResultType.FORM - assert result2.get("step_id") == SOURCE_USER + assert result2.get("step_id") == "user" assert result2.get("errors") == {"mjpeg_url": "cannot_connect"} assert len(mock_setup_entry.mock_calls) == 0 @@ -180,7 +180,7 @@ async def test_connection_error( ) assert result3.get("type") == FlowResultType.FORM - assert result3.get("step_id") == SOURCE_USER + assert result3.get("step_id") == "user" assert result3.get("errors") == {"still_image_url": "cannot_connect"} assert len(mock_setup_entry.mock_calls) == 0 diff --git a/tests/components/moon/test_config_flow.py b/tests/components/moon/test_config_flow.py index e7ee1cceefd..cd2ab94fefc 100644 --- a/tests/components/moon/test_config_flow.py +++ b/tests/components/moon/test_config_flow.py @@ -19,7 +19,7 @@ async def test_full_user_flow( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/nam/test_config_flow.py b/tests/components/nam/test_config_flow.py index 9aafcae2482..78a96e148ce 100644 --- a/tests/components/nam/test_config_flow.py +++ b/tests/components/nam/test_config_flow.py @@ -34,7 +34,7 @@ async def test_form_create_entry_without_auth(hass: HomeAssistant) -> None: DOMAIN, context={"source": SOURCE_USER} ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" assert result["errors"] == {} with patch( @@ -64,7 +64,7 @@ async def test_form_create_entry_with_auth(hass: HomeAssistant) -> None: DOMAIN, context={"source": SOURCE_USER} ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" assert result["errors"] == {} with patch( diff --git a/tests/components/nextdns/test_config_flow.py b/tests/components/nextdns/test_config_flow.py index 07591ed2bbf..b5d718b61aa 100644 --- a/tests/components/nextdns/test_config_flow.py +++ b/tests/components/nextdns/test_config_flow.py @@ -24,7 +24,7 @@ async def test_form_create_entry(hass: HomeAssistant) -> None: DOMAIN, context={"source": SOURCE_USER} ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" assert result["errors"] == {} with patch( diff --git a/tests/components/open_meteo/test_config_flow.py b/tests/components/open_meteo/test_config_flow.py index c81d4da8c91..2eda6a8192b 100644 --- a/tests/components/open_meteo/test_config_flow.py +++ b/tests/components/open_meteo/test_config_flow.py @@ -20,7 +20,7 @@ async def test_full_user_flow( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/openweathermap/test_config_flow.py b/tests/components/openweathermap/test_config_flow.py index 28ba175cbef..2bd62936fe5 100644 --- a/tests/components/openweathermap/test_config_flow.py +++ b/tests/components/openweathermap/test_config_flow.py @@ -47,7 +47,7 @@ async def test_form(hass: HomeAssistant) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" assert result["errors"] == {} result = await hass.config_entries.flow.async_init( diff --git a/tests/components/p1_monitor/test_config_flow.py b/tests/components/p1_monitor/test_config_flow.py index 98dfe184c13..419f24871ef 100644 --- a/tests/components/p1_monitor/test_config_flow.py +++ b/tests/components/p1_monitor/test_config_flow.py @@ -17,7 +17,7 @@ async def test_full_user_flow(hass: HomeAssistant) -> None: ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" with patch( "homeassistant.components.p1_monitor.config_flow.P1Monitor.smartmeter" diff --git a/tests/components/poolsense/test_config_flow.py b/tests/components/poolsense/test_config_flow.py index 6b3a8f7ea6f..71303e48dbf 100644 --- a/tests/components/poolsense/test_config_flow.py +++ b/tests/components/poolsense/test_config_flow.py @@ -15,7 +15,7 @@ async def test_show_form(hass: HomeAssistant) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" async def test_invalid_credentials(hass: HomeAssistant) -> None: diff --git a/tests/components/pure_energie/test_config_flow.py b/tests/components/pure_energie/test_config_flow.py index ebd7aefff20..2b00e975a8e 100644 --- a/tests/components/pure_energie/test_config_flow.py +++ b/tests/components/pure_energie/test_config_flow.py @@ -22,7 +22,7 @@ async def test_full_user_flow_implementation( context={"source": SOURCE_USER}, ) - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" assert result.get("type") == FlowResultType.FORM result = await hass.config_entries.flow.async_configure( diff --git a/tests/components/pvoutput/test_config_flow.py b/tests/components/pvoutput/test_config_flow.py index 36a783f86fb..bf05afa020d 100644 --- a/tests/components/pvoutput/test_config_flow.py +++ b/tests/components/pvoutput/test_config_flow.py @@ -24,7 +24,7 @@ async def test_full_user_flow( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -60,7 +60,7 @@ async def test_full_flow_with_authentication_error( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" mock_pvoutput_config_flow.system.side_effect = PVOutputAuthenticationError result2 = await hass.config_entries.flow.async_configure( @@ -72,7 +72,7 @@ async def test_full_flow_with_authentication_error( ) assert result2.get("type") == FlowResultType.FORM - assert result2.get("step_id") == SOURCE_USER + assert result2.get("step_id") == "user" assert result2.get("errors") == {"base": "invalid_auth"} assert len(mock_setup_entry.mock_calls) == 0 diff --git a/tests/components/qnap_qsw/test_config_flow.py b/tests/components/qnap_qsw/test_config_flow.py index 7c2153d5f90..ab35a9369ea 100644 --- a/tests/components/qnap_qsw/test_config_flow.py +++ b/tests/components/qnap_qsw/test_config_flow.py @@ -49,7 +49,7 @@ async def test_form(hass: HomeAssistant) -> None: ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" assert result["errors"] == {} result = await hass.config_entries.flow.async_configure( diff --git a/tests/components/rdw/test_config_flow.py b/tests/components/rdw/test_config_flow.py index 8dc0dac8b9d..b8c21be300e 100644 --- a/tests/components/rdw/test_config_flow.py +++ b/tests/components/rdw/test_config_flow.py @@ -19,7 +19,7 @@ async def test_full_user_flow( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -46,7 +46,7 @@ async def test_full_flow_with_authentication_error( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" mock_rdw_config_flow.vehicle.side_effect = RDWUnknownLicensePlateError result2 = await hass.config_entries.flow.async_configure( @@ -57,7 +57,7 @@ async def test_full_flow_with_authentication_error( ) assert result2.get("type") == FlowResultType.FORM - assert result2.get("step_id") == SOURCE_USER + assert result2.get("step_id") == "user" assert result2.get("errors") == {"base": "unknown_license_plate"} mock_rdw_config_flow.vehicle.side_effect = None diff --git a/tests/components/season/test_config_flow.py b/tests/components/season/test_config_flow.py index 6579bb53a9b..884c5a3ddc8 100644 --- a/tests/components/season/test_config_flow.py +++ b/tests/components/season/test_config_flow.py @@ -20,7 +20,7 @@ async def test_full_user_flow( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/stookalert/test_config_flow.py b/tests/components/stookalert/test_config_flow.py index aeff4b01de9..0014f4e5ad5 100644 --- a/tests/components/stookalert/test_config_flow.py +++ b/tests/components/stookalert/test_config_flow.py @@ -16,7 +16,7 @@ async def test_full_user_flow(hass: HomeAssistant) -> None: ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" with patch( "homeassistant.components.stookalert.async_setup_entry", return_value=True diff --git a/tests/components/stookwijzer/test_config_flow.py b/tests/components/stookwijzer/test_config_flow.py index b18eb54b322..90786659254 100644 --- a/tests/components/stookwijzer/test_config_flow.py +++ b/tests/components/stookwijzer/test_config_flow.py @@ -15,7 +15,7 @@ async def test_full_user_flow(hass: HomeAssistant) -> None: ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" assert "flow_id" in result with patch( diff --git a/tests/components/sun/test_config_flow.py b/tests/components/sun/test_config_flow.py index 2d4e2d83249..2bf577f82b8 100644 --- a/tests/components/sun/test_config_flow.py +++ b/tests/components/sun/test_config_flow.py @@ -18,7 +18,7 @@ async def test_full_user_flow(hass: HomeAssistant) -> None: ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" with patch( "homeassistant.components.sun.async_setup_entry", diff --git a/tests/components/tailscale/test_config_flow.py b/tests/components/tailscale/test_config_flow.py index 45e3e85d878..5bf814a56d6 100644 --- a/tests/components/tailscale/test_config_flow.py +++ b/tests/components/tailscale/test_config_flow.py @@ -24,7 +24,7 @@ async def test_full_user_flow( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -60,7 +60,7 @@ async def test_full_flow_with_authentication_error( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" mock_tailscale_config_flow.devices.side_effect = TailscaleAuthenticationError result2 = await hass.config_entries.flow.async_configure( @@ -72,7 +72,7 @@ async def test_full_flow_with_authentication_error( ) assert result2.get("type") == FlowResultType.FORM - assert result2.get("step_id") == SOURCE_USER + assert result2.get("step_id") == "user" assert result2.get("errors") == {"base": "invalid_auth"} assert len(mock_setup_entry.mock_calls) == 0 diff --git a/tests/components/tolo/test_config_flow.py b/tests/components/tolo/test_config_flow.py index 649a21f5bcf..aa88766c395 100644 --- a/tests/components/tolo/test_config_flow.py +++ b/tests/components/tolo/test_config_flow.py @@ -34,7 +34,7 @@ async def test_user_with_timed_out_host(hass: HomeAssistant, toloclient: Mock) - ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" assert result["errors"] == {"base": "cannot_connect"} @@ -45,7 +45,7 @@ async def test_user_walkthrough(hass: HomeAssistant, toloclient: Mock) -> None: ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" toloclient().get_status_info.side_effect = lambda *args, **kwargs: None @@ -55,7 +55,7 @@ async def test_user_walkthrough(hass: HomeAssistant, toloclient: Mock) -> None: ) assert result2["type"] == FlowResultType.FORM - assert result2["step_id"] == SOURCE_USER + assert result2["step_id"] == "user" assert result2["errors"] == {"base": "cannot_connect"} toloclient().get_status_info.side_effect = lambda *args, **kwargs: object() diff --git a/tests/components/twentemilieu/test_config_flow.py b/tests/components/twentemilieu/test_config_flow.py index d8c2c82f4eb..e5875ecaab7 100644 --- a/tests/components/twentemilieu/test_config_flow.py +++ b/tests/components/twentemilieu/test_config_flow.py @@ -30,7 +30,7 @@ async def test_full_user_flow(hass: HomeAssistant, snapshot: SnapshotAssertion) ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -60,7 +60,7 @@ async def test_invalid_address( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" mock_twentemilieu.unique_id.side_effect = TwenteMilieuAddressError result2 = await hass.config_entries.flow.async_configure( @@ -72,7 +72,7 @@ async def test_invalid_address( ) assert result2.get("type") == FlowResultType.FORM - assert result2.get("step_id") == SOURCE_USER + assert result2.get("step_id") == "user" assert result2.get("errors") == {"base": "invalid_address"} mock_twentemilieu.unique_id.side_effect = None @@ -106,7 +106,7 @@ async def test_connection_error( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" assert result.get("errors") == {"base": "cannot_connect"} diff --git a/tests/components/unifi/test_config_flow.py b/tests/components/unifi/test_config_flow.py index 0d358ef5149..d91771322f3 100644 --- a/tests/components/unifi/test_config_flow.py +++ b/tests/components/unifi/test_config_flow.py @@ -21,7 +21,7 @@ from homeassistant.components.unifi.const import ( CONF_TRACK_WIRED_CLIENTS, DOMAIN as UNIFI_DOMAIN, ) -from homeassistant.config_entries import SOURCE_REAUTH, SOURCE_USER +from homeassistant.config_entries import SOURCE_REAUTH from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, @@ -398,7 +398,7 @@ async def test_reauth_flow_update_configuration( ) assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" aioclient_mock.clear_requests() diff --git a/tests/components/uptime/test_config_flow.py b/tests/components/uptime/test_config_flow.py index 9f1c3931d18..a2234882b27 100644 --- a/tests/components/uptime/test_config_flow.py +++ b/tests/components/uptime/test_config_flow.py @@ -22,7 +22,7 @@ async def test_full_user_flow( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/venstar/test_config_flow.py b/tests/components/venstar/test_config_flow.py index f8f66f1b388..521e5a8512e 100644 --- a/tests/components/venstar/test_config_flow.py +++ b/tests/components/venstar/test_config_flow.py @@ -4,7 +4,6 @@ from unittest.mock import patch from homeassistant import config_entries from homeassistant.components.venstar.const import DOMAIN -from homeassistant.config_entries import SOURCE_USER from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, @@ -105,7 +104,7 @@ async def test_already_configured(hass: HomeAssistant) -> None: ) assert result["type"] == FlowResultType.FORM - assert result["step_id"] == SOURCE_USER + assert result["step_id"] == "user" with patch( "homeassistant.components.venstar.VenstarColorTouch.update_info", diff --git a/tests/components/whois/test_config_flow.py b/tests/components/whois/test_config_flow.py index 52bb87817f2..91aa207d60f 100644 --- a/tests/components/whois/test_config_flow.py +++ b/tests/components/whois/test_config_flow.py @@ -31,7 +31,7 @@ async def test_full_user_flow( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -71,7 +71,7 @@ async def test_full_flow_with_error( ) assert result.get("type") == FlowResultType.FORM - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" mock_whois.side_effect = throw result2 = await hass.config_entries.flow.async_configure( @@ -80,7 +80,7 @@ async def test_full_flow_with_error( ) assert result2.get("type") == FlowResultType.FORM - assert result2.get("step_id") == SOURCE_USER + assert result2.get("step_id") == "user" assert result2.get("errors") == {"base": reason} assert len(mock_setup_entry.mock_calls) == 0 diff --git a/tests/components/youless/test_config_flows.py b/tests/components/youless/test_config_flows.py index 08f38f8eb2c..6512103cde0 100644 --- a/tests/components/youless/test_config_flows.py +++ b/tests/components/youless/test_config_flows.py @@ -27,7 +27,7 @@ async def test_full_flow(hass: HomeAssistant) -> None: assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" mock_youless = _get_mock_youless_api( initialize={"homes": [{"id": 1, "name": "myhome"}]} @@ -54,7 +54,7 @@ async def test_not_found(hass: HomeAssistant) -> None: assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} - assert result.get("step_id") == SOURCE_USER + assert result.get("step_id") == "user" mock_youless = _get_mock_youless_api(initialize=URLError("")) with patch(