From bcf32f83314a8958769a58b2ee600a93b9c3dd8b Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Fri, 30 Dec 2022 12:01:45 +0100 Subject: [PATCH] Mark required fields in FlowResult typedict (#84811) * Mark required fields in FlowResult typedict * Remove unneeded asserts from tests --- homeassistant/data_entry_flow.py | 5 ++-- tests/components/bsblan/test_config_flow.py | 1 - tests/components/cpuspeed/test_config_flow.py | 2 -- tests/components/elgato/test_config_flow.py | 2 -- tests/components/filesize/test_config_flow.py | 1 - .../forecast_solar/test_config_flow.py | 4 --- .../fully_kiosk/test_config_flow.py | 3 --- .../garages_amsterdam/test_config_flow.py | 1 - .../components/geocaching/test_config_flow.py | 4 --- tests/components/github/test_config_flow.py | 1 - .../components/justnimbus/test_config_flow.py | 1 - tests/components/lametric/test_config_flow.py | 13 ---------- .../components/luftdaten/test_config_flow.py | 6 ----- tests/components/mjpeg/test_config_flow.py | 12 --------- .../modern_forms/test_config_flow.py | 2 -- tests/components/moon/test_config_flow.py | 1 - .../components/motioneye/test_config_flow.py | 3 --- .../components/open_meteo/test_config_flow.py | 1 - .../components/p1_monitor/test_config_flow.py | 1 - tests/components/plugwise/test_config_flow.py | 4 --- .../pure_energie/test_config_flow.py | 2 -- tests/components/pvoutput/test_config_flow.py | 8 ------ .../radio_browser/test_config_flow.py | 1 - tests/components/rdw/test_config_flow.py | 3 --- .../rtsp_to_webrtc/test_config_flow.py | 5 ---- tests/components/season/test_config_flow.py | 1 - tests/components/sentry/test_config_flow.py | 4 --- .../components/soundtouch/test_config_flow.py | 1 - .../components/stookalert/test_config_flow.py | 3 --- tests/components/sun/test_config_flow.py | 1 - .../components/tailscale/test_config_flow.py | 7 ------ tests/components/tolo/test_config_flow.py | 2 -- .../twentemilieu/test_config_flow.py | 3 --- tests/components/uptime/test_config_flow.py | 1 - tests/components/verisure/test_config_flow.py | 25 ------------------- tests/components/whois/test_config_flow.py | 3 --- tests/components/wled/test_config_flow.py | 3 --- tests/components/youless/test_config_flows.py | 2 -- tests/components/zamg/test_config_flow.py | 5 ---- 39 files changed, 3 insertions(+), 145 deletions(-) diff --git a/homeassistant/data_entry_flow.py b/homeassistant/data_entry_flow.py index a98c616ffbc..70c09020ca3 100644 --- a/homeassistant/data_entry_flow.py +++ b/homeassistant/data_entry_flow.py @@ -10,6 +10,7 @@ import logging from types import MappingProxyType from typing import Any, TypedDict +from typing_extensions import Required import voluptuous as vol from .backports.enum import StrEnum @@ -91,8 +92,8 @@ class FlowResult(TypedDict, total=False): description: str | None errors: dict[str, str] | None extra: str - flow_id: str - handler: str + flow_id: Required[str] + handler: Required[str] last_step: bool | None menu_options: list[str] | dict[str, str] options: Mapping[str, Any] diff --git a/tests/components/bsblan/test_config_flow.py b/tests/components/bsblan/test_config_flow.py index a1286f43695..ab8d4237588 100644 --- a/tests/components/bsblan/test_config_flow.py +++ b/tests/components/bsblan/test_config_flow.py @@ -32,7 +32,6 @@ async def test_full_user_flow_implementation( assert result.get("type") == RESULT_TYPE_FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result 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 c016cfdb1d9..2d0f4c6df22 100644 --- a/tests/components/cpuspeed/test_config_flow.py +++ b/tests/components/cpuspeed/test_config_flow.py @@ -22,7 +22,6 @@ async def test_full_user_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -69,7 +68,6 @@ async def test_not_compatible( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result mock_cpuinfo_config_flow.return_value = {} result2 = await hass.config_entries.flow.async_configure( diff --git a/tests/components/elgato/test_config_flow.py b/tests/components/elgato/test_config_flow.py index dbdfbfed1d0..bb5a2375f80 100644 --- a/tests/components/elgato/test_config_flow.py +++ b/tests/components/elgato/test_config_flow.py @@ -26,7 +26,6 @@ async def test_full_user_flow_implementation( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={CONF_HOST: "127.0.0.1", CONF_PORT: 9123} @@ -69,7 +68,6 @@ async def test_full_zeroconf_flow_implementation( assert result.get("description_placeholders") == {"serial_number": "CN11A1A00001"} assert result.get("step_id") == "zeroconf_confirm" assert result.get("type") == FlowResultType.FORM - assert "flow_id" in result progress = hass.config_entries.flow.async_progress() assert len(progress) == 1 diff --git a/tests/components/filesize/test_config_flow.py b/tests/components/filesize/test_config_flow.py index ed9d4004b1a..2bdc1ed82a0 100644 --- a/tests/components/filesize/test_config_flow.py +++ b/tests/components/filesize/test_config_flow.py @@ -22,7 +22,6 @@ async def test_full_user_flow(hass: HomeAssistant) -> None: assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/forecast_solar/test_config_flow.py b/tests/components/forecast_solar/test_config_flow.py index 616dcba4a36..41cfb4d839e 100644 --- a/tests/components/forecast_solar/test_config_flow.py +++ b/tests/components/forecast_solar/test_config_flow.py @@ -25,7 +25,6 @@ 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 "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -68,7 +67,6 @@ async def test_options_flow_invalid_api( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "init" - assert "flow_id" in result result2 = await hass.config_entries.options.async_configure( result["flow_id"], @@ -101,7 +99,6 @@ async def test_options_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "init" - assert "flow_id" in result # With the API key result2 = await hass.config_entries.options.async_configure( @@ -142,7 +139,6 @@ async def test_options_flow_without_key( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "init" - assert "flow_id" in result # Without the API key result2 = await hass.config_entries.options.async_configure( diff --git a/tests/components/fully_kiosk/test_config_flow.py b/tests/components/fully_kiosk/test_config_flow.py index 19a8715b4cd..719d2442c51 100644 --- a/tests/components/fully_kiosk/test_config_flow.py +++ b/tests/components/fully_kiosk/test_config_flow.py @@ -28,7 +28,6 @@ async def test_full_flow( ) assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -72,7 +71,6 @@ async def test_errors( result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result flow_id = result["flow_id"] mock_fully_kiosk_config_flow.getDeviceInfo.side_effect = side_effect @@ -119,7 +117,6 @@ async def test_duplicate_updates_existing_entry( ) assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/garages_amsterdam/test_config_flow.py b/tests/components/garages_amsterdam/test_config_flow.py index dfb4531fa1d..f39aea541aa 100644 --- a/tests/components/garages_amsterdam/test_config_flow.py +++ b/tests/components/garages_amsterdam/test_config_flow.py @@ -18,7 +18,6 @@ async def test_full_flow(hass: HomeAssistant) -> None: DOMAIN, context={"source": config_entries.SOURCE_USER} ) assert result.get("type") == FlowResultType.FORM - assert "flow_id" in result with patch( "homeassistant.components.garages_amsterdam.async_setup_entry", diff --git a/tests/components/geocaching/test_config_flow.py b/tests/components/geocaching/test_config_flow.py index a40668c627f..f4be02d4318 100644 --- a/tests/components/geocaching/test_config_flow.py +++ b/tests/components/geocaching/test_config_flow.py @@ -52,7 +52,6 @@ async def test_full_flow( result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result # pylint: disable=protected-access state = config_entry_oauth2_flow._encode_jwt( @@ -110,7 +109,6 @@ async def test_existing_entry( result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result # pylint: disable=protected-access state = config_entry_oauth2_flow._encode_jwt( hass, @@ -151,7 +149,6 @@ async def test_oauth_error( result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result # pylint: disable=protected-access state = config_entry_oauth2_flow._encode_jwt( @@ -209,7 +206,6 @@ async def test_reauthentication( assert "flow_id" in flows[0] result = await hass.config_entries.flow.async_configure(flows[0]["flow_id"], {}) - assert "flow_id" in result # pylint: disable=protected-access state = config_entry_oauth2_flow._encode_jwt( diff --git a/tests/components/github/test_config_flow.py b/tests/components/github/test_config_flow.py index 174d70c3ae3..ad3be582a5d 100644 --- a/tests/components/github/test_config_flow.py +++ b/tests/components/github/test_config_flow.py @@ -59,7 +59,6 @@ async def test_full_user_flow_implementation( assert result["step_id"] == "device" assert result["type"] == FlowResultType.SHOW_PROGRESS - assert "flow_id" in result result = await hass.config_entries.flow.async_configure(result["flow_id"]) diff --git a/tests/components/justnimbus/test_config_flow.py b/tests/components/justnimbus/test_config_flow.py index 1d3565c21bd..1d75a72fe2e 100644 --- a/tests/components/justnimbus/test_config_flow.py +++ b/tests/components/justnimbus/test_config_flow.py @@ -83,7 +83,6 @@ async def test_abort_already_configured(hass: HomeAssistant) -> None: ) assert result.get("type") == FlowResultType.FORM assert result.get("errors") is None - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( flow_id=result["flow_id"], diff --git a/tests/components/lametric/test_config_flow.py b/tests/components/lametric/test_config_flow.py index a23b50c9813..f09b48af9fb 100644 --- a/tests/components/lametric/test_config_flow.py +++ b/tests/components/lametric/test_config_flow.py @@ -60,7 +60,6 @@ async def test_full_cloud_import_flow_multiple_devices( assert result.get("type") == FlowResultType.MENU assert result.get("step_id") == "choice_enter_manual_or_fetch_cloud" assert result.get("menu_options") == ["pick_implementation", "manual_entry"] - assert "flow_id" in result flow_id = result["flow_id"] result2 = await hass.config_entries.flow.async_configure( @@ -142,7 +141,6 @@ async def test_full_cloud_import_flow_single_device( assert result.get("type") == FlowResultType.MENU assert result.get("step_id") == "choice_enter_manual_or_fetch_cloud" assert result.get("menu_options") == ["pick_implementation", "manual_entry"] - assert "flow_id" in result flow_id = result["flow_id"] result2 = await hass.config_entries.flow.async_configure( @@ -218,7 +216,6 @@ async def test_full_manual( assert result.get("type") == FlowResultType.MENU assert result.get("step_id") == "choice_enter_manual_or_fetch_cloud" assert result.get("menu_options") == ["pick_implementation", "manual_entry"] - assert "flow_id" in result flow_id = result["flow_id"] result2 = await hass.config_entries.flow.async_configure( @@ -264,7 +261,6 @@ async def test_full_ssdp_with_cloud_import( assert result.get("type") == FlowResultType.MENU assert result.get("step_id") == "choice_enter_manual_or_fetch_cloud" assert result.get("menu_options") == ["pick_implementation", "manual_entry"] - assert "flow_id" in result flow_id = result["flow_id"] result2 = await hass.config_entries.flow.async_configure( @@ -335,7 +331,6 @@ async def test_full_ssdp_manual_entry( assert result.get("type") == FlowResultType.MENU assert result.get("step_id") == "choice_enter_manual_or_fetch_cloud" assert result.get("menu_options") == ["pick_implementation", "manual_entry"] - assert "flow_id" in result flow_id = result["flow_id"] result2 = await hass.config_entries.flow.async_configure( @@ -410,7 +405,6 @@ async def test_cloud_import_updates_existing_entry( result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result flow_id = result["flow_id"] await hass.config_entries.flow.async_configure( @@ -466,7 +460,6 @@ async def test_manual_updates_existing_entry( result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result flow_id = result["flow_id"] await hass.config_entries.flow.async_configure( @@ -519,7 +512,6 @@ async def test_cloud_abort_no_devices( result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result flow_id = result["flow_id"] await hass.config_entries.flow.async_configure( @@ -576,7 +568,6 @@ async def test_manual_errors( result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result flow_id = result["flow_id"] await hass.config_entries.flow.async_configure( @@ -640,7 +631,6 @@ async def test_cloud_errors( result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result flow_id = result["flow_id"] await hass.config_entries.flow.async_configure( @@ -773,7 +763,6 @@ async def test_reauth_cloud_import( data=mock_config_entry.data, ) - assert "flow_id" in result flow_id = result["flow_id"] await hass.config_entries.flow.async_configure( @@ -840,7 +829,6 @@ async def test_reauth_cloud_abort_device_not_found( data=mock_config_entry.data, ) - assert "flow_id" in result flow_id = result["flow_id"] await hass.config_entries.flow.async_configure( @@ -897,7 +885,6 @@ async def test_reauth_manual( data=mock_config_entry.data, ) - assert "flow_id" in result flow_id = result["flow_id"] await hass.config_entries.flow.async_configure( diff --git a/tests/components/luftdaten/test_config_flow.py b/tests/components/luftdaten/test_config_flow.py index 25d41c0c2d0..d98e415482d 100644 --- a/tests/components/luftdaten/test_config_flow.py +++ b/tests/components/luftdaten/test_config_flow.py @@ -25,7 +25,6 @@ async def test_duplicate_error( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -46,7 +45,6 @@ async def test_communication_error( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result mock_luftdaten_config_flow.get_data.side_effect = LuftdatenConnectionError result2 = await hass.config_entries.flow.async_configure( @@ -57,7 +55,6 @@ async def test_communication_error( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == SOURCE_USER assert result2.get("errors") == {CONF_SENSOR_ID: "cannot_connect"} - assert "flow_id" in result2 mock_luftdaten_config_flow.get_data.side_effect = None result3 = await hass.config_entries.flow.async_configure( @@ -83,7 +80,6 @@ async def test_invalid_sensor( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result mock_luftdaten_config_flow.validate_sensor.return_value = False result2 = await hass.config_entries.flow.async_configure( @@ -94,7 +90,6 @@ async def test_invalid_sensor( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == SOURCE_USER assert result2.get("errors") == {CONF_SENSOR_ID: "invalid_sensor"} - assert "flow_id" in result2 mock_luftdaten_config_flow.validate_sensor.return_value = True result3 = await hass.config_entries.flow.async_configure( @@ -122,7 +117,6 @@ async def test_step_user( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result 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 3d66af21f0a..c95f4f1c40f 100644 --- a/tests/components/mjpeg/test_config_flow.py +++ b/tests/components/mjpeg/test_config_flow.py @@ -37,7 +37,6 @@ async def test_full_user_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -83,7 +82,6 @@ async def test_full_flow_with_authentication_error( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result mock_mjpeg_requests.get( "https://example.com/mjpeg", text="Access Denied!", status_code=401 @@ -101,7 +99,6 @@ async def test_full_flow_with_authentication_error( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == SOURCE_USER assert result2.get("errors") == {"username": "invalid_auth"} - assert "flow_id" in result2 assert len(mock_setup_entry.mock_calls) == 0 assert mock_mjpeg_requests.call_count == 2 @@ -145,7 +142,6 @@ async def test_connection_error( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result # Test connectione error on MJPEG url mock_mjpeg_requests.get( @@ -163,7 +159,6 @@ async def test_connection_error( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == SOURCE_USER assert result2.get("errors") == {"mjpeg_url": "cannot_connect"} - assert "flow_id" in result2 assert len(mock_setup_entry.mock_calls) == 0 assert mock_mjpeg_requests.call_count == 1 @@ -187,7 +182,6 @@ async def test_connection_error( assert result3.get("type") == FlowResultType.FORM assert result3.get("step_id") == SOURCE_USER assert result3.get("errors") == {"still_image_url": "cannot_connect"} - assert "flow_id" in result3 assert len(mock_setup_entry.mock_calls) == 0 assert mock_mjpeg_requests.call_count == 3 @@ -233,7 +227,6 @@ async def test_already_configured( result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -257,7 +250,6 @@ async def test_options_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "init" - assert "flow_id" in result # Register a second camera mock_mjpeg_requests.get("https://example.com/second_camera", text="resp") @@ -287,7 +279,6 @@ async def test_options_flow( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == "init" assert result2.get("errors") == {"mjpeg_url": "already_configured"} - assert "flow_id" in result2 assert mock_mjpeg_requests.call_count == 1 @@ -306,7 +297,6 @@ async def test_options_flow( assert result3.get("type") == FlowResultType.FORM assert result3.get("step_id") == "init" assert result3.get("errors") == {"mjpeg_url": "cannot_connect"} - assert "flow_id" in result3 assert mock_mjpeg_requests.call_count == 2 @@ -325,7 +315,6 @@ async def test_options_flow( assert result4.get("type") == FlowResultType.FORM assert result4.get("step_id") == "init" assert result4.get("errors") == {"still_image_url": "cannot_connect"} - assert "flow_id" in result4 assert mock_mjpeg_requests.call_count == 4 @@ -345,7 +334,6 @@ async def test_options_flow( assert result5.get("type") == FlowResultType.FORM assert result5.get("step_id") == "init" assert result5.get("errors") == {"username": "invalid_auth"} - assert "flow_id" in result5 assert mock_mjpeg_requests.call_count == 6 diff --git a/tests/components/modern_forms/test_config_flow.py b/tests/components/modern_forms/test_config_flow.py index 05cebb2fef5..540a8fef93d 100644 --- a/tests/components/modern_forms/test_config_flow.py +++ b/tests/components/modern_forms/test_config_flow.py @@ -34,7 +34,6 @@ async def test_full_user_flow_implementation( assert result.get("step_id") == "user" assert result.get("type") == FlowResultType.FORM - assert "flow_id" in result with patch( "homeassistant.components.modern_forms.async_setup_entry", @@ -82,7 +81,6 @@ async def test_full_zeroconf_flow_implementation( assert result.get("description_placeholders") == {CONF_NAME: "example"} assert result.get("step_id") == "zeroconf_confirm" assert result.get("type") == FlowResultType.FORM - assert "flow_id" in result flow = flows[0] assert "context" in flow diff --git a/tests/components/moon/test_config_flow.py b/tests/components/moon/test_config_flow.py index 9dfc186d492..2ef01b4f890 100644 --- a/tests/components/moon/test_config_flow.py +++ b/tests/components/moon/test_config_flow.py @@ -23,7 +23,6 @@ async def test_full_user_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/motioneye/test_config_flow.py b/tests/components/motioneye/test_config_flow.py index edb987e5664..a7bf537add6 100644 --- a/tests/components/motioneye/test_config_flow.py +++ b/tests/components/motioneye/test_config_flow.py @@ -86,12 +86,10 @@ async def test_hassio_success(hass: HomeAssistant) -> None: assert result.get("type") == data_entry_flow.FlowResultType.FORM assert result.get("step_id") == "hassio_confirm" assert result.get("description_placeholders") == {"addon": "motionEye"} - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure(result["flow_id"], {}) assert result2.get("type") == data_entry_flow.FlowResultType.FORM assert result2.get("step_id") == "user" - assert "flow_id" in result2 mock_client = create_mock_motioneye_client() @@ -423,7 +421,6 @@ async def test_hassio_clean_up_on_user_flow(hass: HomeAssistant) -> None: DOMAIN, context={"source": config_entries.SOURCE_USER} ) assert result2.get("type") == data_entry_flow.FlowResultType.FORM - assert "flow_id" in result2 mock_client = create_mock_motioneye_client() diff --git a/tests/components/open_meteo/test_config_flow.py b/tests/components/open_meteo/test_config_flow.py index 0dd81d35856..c81d4da8c91 100644 --- a/tests/components/open_meteo/test_config_flow.py +++ b/tests/components/open_meteo/test_config_flow.py @@ -21,7 +21,6 @@ async def test_full_user_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/p1_monitor/test_config_flow.py b/tests/components/p1_monitor/test_config_flow.py index d7d0608e5b3..98dfe184c13 100644 --- a/tests/components/p1_monitor/test_config_flow.py +++ b/tests/components/p1_monitor/test_config_flow.py @@ -18,7 +18,6 @@ async def test_full_user_flow(hass: HomeAssistant) -> None: assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result with patch( "homeassistant.components.p1_monitor.config_flow.P1Monitor.smartmeter" diff --git a/tests/components/plugwise/test_config_flow.py b/tests/components/plugwise/test_config_flow.py index b569cb08ddf..200ab304ce7 100644 --- a/tests/components/plugwise/test_config_flow.py +++ b/tests/components/plugwise/test_config_flow.py @@ -121,7 +121,6 @@ async def test_form( assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} assert result.get("step_id") == "user" - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -169,7 +168,6 @@ async def test_zeroconf_flow( assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} assert result.get("step_id") == "user" - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -205,7 +203,6 @@ async def test_zeroconf_flow_stretch( assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} assert result.get("step_id") == "user" - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -297,7 +294,6 @@ async def test_flow_errors( assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} assert result.get("step_id") == "user" - assert "flow_id" in result mock_smile_config_flow.connect.side_effect = side_effect result2 = await hass.config_entries.flow.async_configure( diff --git a/tests/components/pure_energie/test_config_flow.py b/tests/components/pure_energie/test_config_flow.py index d1ed8eeb578..ebd7aefff20 100644 --- a/tests/components/pure_energie/test_config_flow.py +++ b/tests/components/pure_energie/test_config_flow.py @@ -24,7 +24,6 @@ async def test_full_user_flow_implementation( assert result.get("step_id") == SOURCE_USER assert result.get("type") == FlowResultType.FORM - assert "flow_id" in result result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={CONF_HOST: "192.168.1.123"} @@ -64,7 +63,6 @@ async def test_full_zeroconf_flow_implementationn( } assert result.get("step_id") == "zeroconf_confirm" assert result.get("type") == FlowResultType.FORM - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={} diff --git a/tests/components/pvoutput/test_config_flow.py b/tests/components/pvoutput/test_config_flow.py index 9d6162e4d46..36a783f86fb 100644 --- a/tests/components/pvoutput/test_config_flow.py +++ b/tests/components/pvoutput/test_config_flow.py @@ -25,7 +25,6 @@ async def test_full_user_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -62,7 +61,6 @@ async def test_full_flow_with_authentication_error( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result mock_pvoutput_config_flow.system.side_effect = PVOutputAuthenticationError result2 = await hass.config_entries.flow.async_configure( @@ -76,7 +74,6 @@ async def test_full_flow_with_authentication_error( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == SOURCE_USER assert result2.get("errors") == {"base": "invalid_auth"} - assert "flow_id" in result2 assert len(mock_setup_entry.mock_calls) == 0 assert len(mock_pvoutput_config_flow.system.mock_calls) == 1 @@ -133,7 +130,6 @@ async def test_already_configured( result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -167,7 +163,6 @@ async def test_reauth_flow( ) assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "reauth_confirm" - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -210,7 +205,6 @@ async def test_reauth_with_authentication_error( ) assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "reauth_confirm" - assert "flow_id" in result mock_pvoutput_config_flow.system.side_effect = PVOutputAuthenticationError result2 = await hass.config_entries.flow.async_configure( @@ -222,7 +216,6 @@ async def test_reauth_with_authentication_error( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == "reauth_confirm" assert result2.get("errors") == {"base": "invalid_auth"} - assert "flow_id" in result2 assert len(mock_setup_entry.mock_calls) == 0 assert len(mock_pvoutput_config_flow.system.mock_calls) == 1 @@ -264,7 +257,6 @@ async def test_reauth_api_error( ) assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "reauth_confirm" - assert "flow_id" in result mock_pvoutput_config_flow.system.side_effect = PVOutputConnectionError result2 = await hass.config_entries.flow.async_configure( diff --git a/tests/components/radio_browser/test_config_flow.py b/tests/components/radio_browser/test_config_flow.py index 56ed98f145b..d958efc4e50 100644 --- a/tests/components/radio_browser/test_config_flow.py +++ b/tests/components/radio_browser/test_config_flow.py @@ -16,7 +16,6 @@ async def test_full_user_flow(hass: HomeAssistant, mock_setup_entry: AsyncMock) ) assert result.get("type") == FlowResultType.FORM assert result.get("errors") is None - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/rdw/test_config_flow.py b/tests/components/rdw/test_config_flow.py index 0fe40c29dfa..8dc0dac8b9d 100644 --- a/tests/components/rdw/test_config_flow.py +++ b/tests/components/rdw/test_config_flow.py @@ -20,7 +20,6 @@ async def test_full_user_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -48,7 +47,6 @@ async def test_full_flow_with_authentication_error( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result mock_rdw_config_flow.vehicle.side_effect = RDWUnknownLicensePlateError result2 = await hass.config_entries.flow.async_configure( @@ -61,7 +59,6 @@ async def test_full_flow_with_authentication_error( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == SOURCE_USER assert result2.get("errors") == {"base": "unknown_license_plate"} - assert "flow_id" in result2 mock_rdw_config_flow.vehicle.side_effect = None result3 = await hass.config_entries.flow.async_configure( diff --git a/tests/components/rtsp_to_webrtc/test_config_flow.py b/tests/components/rtsp_to_webrtc/test_config_flow.py index 6386a942cc4..6101a045ffd 100644 --- a/tests/components/rtsp_to_webrtc/test_config_flow.py +++ b/tests/components/rtsp_to_webrtc/test_config_flow.py @@ -26,7 +26,6 @@ async def test_web_full_flow(hass: HomeAssistant) -> None: assert result.get("step_id") == "user" assert result.get("data_schema").schema.get("server_url") == str assert not result.get("errors") - assert "flow_id" in result with patch("rtsp_to_webrtc.client.Client.heartbeat"), patch( "homeassistant.components.rtsp_to_webrtc.async_setup_entry", return_value=True, @@ -63,7 +62,6 @@ async def test_invalid_url(hass: HomeAssistant) -> None: assert result.get("step_id") == "user" assert result.get("data_schema").schema.get("server_url") == str assert not result.get("errors") - assert "flow_id" in result result = await hass.config_entries.flow.async_configure( result["flow_id"], {"server_url": "not-a-url"} ) @@ -81,7 +79,6 @@ async def test_server_unreachable(hass: HomeAssistant) -> None: assert result.get("type") == "form" assert result.get("step_id") == "user" assert not result.get("errors") - assert "flow_id" in result with patch( "rtsp_to_webrtc.client.Client.heartbeat", side_effect=rtsp_to_webrtc.exceptions.ClientError(), @@ -102,7 +99,6 @@ async def test_server_failure(hass: HomeAssistant) -> None: assert result.get("type") == "form" assert result.get("step_id") == "user" assert not result.get("errors") - assert "flow_id" in result with patch( "rtsp_to_webrtc.client.Client.heartbeat", side_effect=rtsp_to_webrtc.exceptions.ResponseError(), @@ -214,7 +210,6 @@ async def test_hassio_discovery_server_failure(hass: HomeAssistant) -> None: assert result.get("type") == "form" assert result.get("step_id") == "hassio_confirm" assert not result.get("errors") - assert "flow_id" in result with patch( "rtsp_to_webrtc.client.Client.heartbeat", diff --git a/tests/components/season/test_config_flow.py b/tests/components/season/test_config_flow.py index 9a64bcd140a..2cf9e46b666 100644 --- a/tests/components/season/test_config_flow.py +++ b/tests/components/season/test_config_flow.py @@ -27,7 +27,6 @@ async def test_full_user_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/sentry/test_config_flow.py b/tests/components/sentry/test_config_flow.py index 984c486c69e..34ed1d2c4b5 100644 --- a/tests/components/sentry/test_config_flow.py +++ b/tests/components/sentry/test_config_flow.py @@ -30,7 +30,6 @@ async def test_full_user_flow_implementation(hass: HomeAssistant) -> None: ) assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} - assert "flow_id" in result with patch("homeassistant.components.sentry.config_flow.Dsn"), patch( "homeassistant.components.sentry.async_setup_entry", @@ -67,7 +66,6 @@ async def test_user_flow_bad_dsn(hass: HomeAssistant) -> None: result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result with patch( "homeassistant.components.sentry.config_flow.Dsn", @@ -87,7 +85,6 @@ async def test_user_flow_unknown_exception(hass: HomeAssistant) -> None: result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result with patch( "homeassistant.components.sentry.config_flow.Dsn", @@ -118,7 +115,6 @@ async def test_options_flow(hass: HomeAssistant) -> None: assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "init" - assert "flow_id" in result result = await hass.config_entries.options.async_configure( result["flow_id"], diff --git a/tests/components/soundtouch/test_config_flow.py b/tests/components/soundtouch/test_config_flow.py index cbeb27be979..92a96d4c9a8 100644 --- a/tests/components/soundtouch/test_config_flow.py +++ b/tests/components/soundtouch/test_config_flow.py @@ -25,7 +25,6 @@ async def test_user_flow_create_entry( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "user" - assert "flow_id" in result with patch( "homeassistant.components.soundtouch.async_setup_entry", return_value=True diff --git a/tests/components/stookalert/test_config_flow.py b/tests/components/stookalert/test_config_flow.py index 50cd56341d6..aeff4b01de9 100644 --- a/tests/components/stookalert/test_config_flow.py +++ b/tests/components/stookalert/test_config_flow.py @@ -17,7 +17,6 @@ async def test_full_user_flow(hass: HomeAssistant) -> None: assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result with patch( "homeassistant.components.stookalert.async_setup_entry", return_value=True @@ -48,8 +47,6 @@ async def test_already_configured(hass: HomeAssistant) -> None: DOMAIN, context={"source": SOURCE_USER} ) - assert "flow_id" in result - result2 = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={ diff --git a/tests/components/sun/test_config_flow.py b/tests/components/sun/test_config_flow.py index 7d20a57ba27..2d4e2d83249 100644 --- a/tests/components/sun/test_config_flow.py +++ b/tests/components/sun/test_config_flow.py @@ -19,7 +19,6 @@ async def test_full_user_flow(hass: HomeAssistant) -> None: assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result 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 78e3f20a61b..45e3e85d878 100644 --- a/tests/components/tailscale/test_config_flow.py +++ b/tests/components/tailscale/test_config_flow.py @@ -25,7 +25,6 @@ async def test_full_user_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -62,7 +61,6 @@ async def test_full_flow_with_authentication_error( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result mock_tailscale_config_flow.devices.side_effect = TailscaleAuthenticationError result2 = await hass.config_entries.flow.async_configure( @@ -76,7 +74,6 @@ async def test_full_flow_with_authentication_error( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == SOURCE_USER assert result2.get("errors") == {"base": "invalid_auth"} - assert "flow_id" in result2 assert len(mock_setup_entry.mock_calls) == 0 assert len(mock_tailscale_config_flow.devices.mock_calls) == 1 @@ -142,7 +139,6 @@ async def test_reauth_flow( ) assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "reauth_confirm" - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -185,7 +181,6 @@ async def test_reauth_with_authentication_error( ) assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "reauth_confirm" - assert "flow_id" in result mock_tailscale_config_flow.devices.side_effect = TailscaleAuthenticationError result2 = await hass.config_entries.flow.async_configure( @@ -197,7 +192,6 @@ async def test_reauth_with_authentication_error( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == "reauth_confirm" assert result2.get("errors") == {"base": "invalid_auth"} - assert "flow_id" in result2 assert len(mock_setup_entry.mock_calls) == 0 assert len(mock_tailscale_config_flow.devices.mock_calls) == 1 @@ -239,7 +233,6 @@ async def test_reauth_api_error( ) assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "reauth_confirm" - assert "flow_id" in result mock_tailscale_config_flow.devices.side_effect = TailscaleConnectionError result2 = await hass.config_entries.flow.async_configure( diff --git a/tests/components/tolo/test_config_flow.py b/tests/components/tolo/test_config_flow.py index 38542ad7db5..5f75a1fd5a2 100644 --- a/tests/components/tolo/test_config_flow.py +++ b/tests/components/tolo/test_config_flow.py @@ -46,7 +46,6 @@ async def test_user_walkthrough(hass: HomeAssistant, toloclient: Mock): assert result["type"] == FlowResultType.FORM assert result["step_id"] == SOURCE_USER - assert "flow_id" in result toloclient().get_status_info.side_effect = lambda *args, **kwargs: None @@ -58,7 +57,6 @@ async def test_user_walkthrough(hass: HomeAssistant, toloclient: Mock): assert result2["type"] == FlowResultType.FORM assert result2["step_id"] == SOURCE_USER assert result2["errors"] == {"base": "cannot_connect"} - assert "flow_id" in result2 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 05e20dd06bd..83e7011b881 100644 --- a/tests/components/twentemilieu/test_config_flow.py +++ b/tests/components/twentemilieu/test_config_flow.py @@ -31,7 +31,6 @@ async def test_full_user_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -68,7 +67,6 @@ async def test_invalid_address( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result mock_twentemilieu_config_flow.unique_id.side_effect = TwenteMilieuAddressError result2 = await hass.config_entries.flow.async_configure( @@ -82,7 +80,6 @@ async def test_invalid_address( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == SOURCE_USER assert result2.get("errors") == {"base": "invalid_address"} - assert "flow_id" in result2 mock_twentemilieu_config_flow.unique_id.side_effect = None result3 = await hass.config_entries.flow.async_configure( diff --git a/tests/components/uptime/test_config_flow.py b/tests/components/uptime/test_config_flow.py index 9db909003e9..77dc91673cf 100644 --- a/tests/components/uptime/test_config_flow.py +++ b/tests/components/uptime/test_config_flow.py @@ -23,7 +23,6 @@ async def test_full_user_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], diff --git a/tests/components/verisure/test_config_flow.py b/tests/components/verisure/test_config_flow.py index 43adc91c38c..8221ab36c04 100644 --- a/tests/components/verisure/test_config_flow.py +++ b/tests/components/verisure/test_config_flow.py @@ -34,7 +34,6 @@ async def test_full_user_flow_single_installation( assert result.get("step_id") == "user" assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} - assert "flow_id" in result mock_verisure_config_flow.installations = [ mock_verisure_config_flow.installations[0] @@ -73,7 +72,6 @@ async def test_full_user_flow_multiple_installations( assert result.get("step_id") == "user" assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -87,7 +85,6 @@ async def test_full_user_flow_multiple_installations( assert result2.get("step_id") == "installation" assert result2.get("type") == FlowResultType.FORM assert result2.get("errors") is None - assert "flow_id" in result2 result3 = await hass.config_entries.flow.async_configure( result2["flow_id"], {"giid": "54321"} @@ -118,7 +115,6 @@ async def test_full_user_flow_single_installation_with_mfa( assert result.get("step_id") == "user" assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} - assert "flow_id" in result mock_verisure_config_flow.login.side_effect = VerisureLoginError( "Multifactor authentication enabled, disable or create MFA cookie" @@ -135,7 +131,6 @@ async def test_full_user_flow_single_installation_with_mfa( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == "mfa" - assert "flow_id" in result2 mock_verisure_config_flow.login.side_effect = None mock_verisure_config_flow.installations = [ @@ -176,7 +171,6 @@ async def test_full_user_flow_multiple_installations_with_mfa( assert result.get("step_id") == "user" assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} - assert "flow_id" in result mock_verisure_config_flow.login.side_effect = VerisureLoginError( "Multifactor authentication enabled, disable or create MFA cookie" @@ -193,7 +187,6 @@ async def test_full_user_flow_multiple_installations_with_mfa( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == "mfa" - assert "flow_id" in result2 mock_verisure_config_flow.login.side_effect = None @@ -208,7 +201,6 @@ async def test_full_user_flow_multiple_installations_with_mfa( assert result3.get("step_id") == "installation" assert result3.get("type") == FlowResultType.FORM assert result3.get("errors") is None - assert "flow_id" in result2 result4 = await hass.config_entries.flow.async_configure( result3["flow_id"], {"giid": "54321"} @@ -248,8 +240,6 @@ async def test_verisure_errors( DOMAIN, context={"source": config_entries.SOURCE_USER} ) - assert "flow_id" in result - mock_verisure_config_flow.login.side_effect = side_effect result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -263,7 +253,6 @@ async def test_verisure_errors( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == "user" assert result2.get("errors") == {"base": error} - assert "flow_id" in result2 mock_verisure_config_flow.login.side_effect = VerisureLoginError( "Multifactor authentication enabled, disable or create MFA cookie" @@ -284,7 +273,6 @@ async def test_verisure_errors( assert result3.get("type") == FlowResultType.FORM assert result3.get("step_id") == "user" assert result3.get("errors") == {"base": "unknown_mfa"} - assert "flow_id" in result3 result4 = await hass.config_entries.flow.async_configure( result3["flow_id"], @@ -297,7 +285,6 @@ async def test_verisure_errors( assert result4.get("type") == FlowResultType.FORM assert result4.get("step_id") == "mfa" - assert "flow_id" in result4 mock_verisure_config_flow.mfa_validate.side_effect = side_effect @@ -310,7 +297,6 @@ async def test_verisure_errors( assert result5.get("type") == FlowResultType.FORM assert result5.get("step_id") == "mfa" assert result5.get("errors") == {"base": error} - assert "flow_id" in result5 mock_verisure_config_flow.installations = [ mock_verisure_config_flow.installations[0] @@ -376,7 +362,6 @@ async def test_reauth_flow( assert result.get("step_id") == "reauth_confirm" assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -420,7 +405,6 @@ async def test_reauth_flow_with_mfa( assert result.get("step_id") == "reauth_confirm" assert result.get("type") == FlowResultType.FORM assert result.get("errors") == {} - assert "flow_id" in result mock_verisure_config_flow.login.side_effect = VerisureLoginError( "Multifactor authentication enabled, disable or create MFA cookie" @@ -437,7 +421,6 @@ async def test_reauth_flow_with_mfa( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == "reauth_mfa" - assert "flow_id" in result2 mock_verisure_config_flow.login.side_effect = None @@ -491,8 +474,6 @@ async def test_reauth_flow_errors( data=mock_config_entry.data, ) - assert "flow_id" in result - mock_verisure_config_flow.login.side_effect = side_effect result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -506,7 +487,6 @@ async def test_reauth_flow_errors( assert result2.get("step_id") == "reauth_confirm" assert result2.get("type") == FlowResultType.FORM assert result2.get("errors") == {"base": error} - assert "flow_id" in result2 mock_verisure_config_flow.login.side_effect = VerisureLoginError( "Multifactor authentication enabled, disable or create MFA cookie" @@ -525,7 +505,6 @@ async def test_reauth_flow_errors( assert result3.get("type") == FlowResultType.FORM assert result3.get("step_id") == "reauth_confirm" assert result3.get("errors") == {"base": "unknown_mfa"} - assert "flow_id" in result3 mock_verisure_config_flow.login_mfa.side_effect = None @@ -540,7 +519,6 @@ async def test_reauth_flow_errors( assert result4.get("type") == FlowResultType.FORM assert result4.get("step_id") == "reauth_mfa" - assert "flow_id" in result4 mock_verisure_config_flow.mfa_validate.side_effect = side_effect @@ -553,7 +531,6 @@ async def test_reauth_flow_errors( assert result5.get("type") == FlowResultType.FORM assert result5.get("step_id") == "reauth_mfa" assert result5.get("errors") == {"base": error} - assert "flow_id" in result5 mock_verisure_config_flow.mfa_validate.side_effect = None mock_verisure_config_flow.login.side_effect = None @@ -627,7 +604,6 @@ async def test_options_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "init" - assert "flow_id" in result result = await hass.config_entries.options.async_configure( result["flow_id"], @@ -659,7 +635,6 @@ async def test_options_flow_code_format_mismatch(hass: HomeAssistant) -> None: assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "init" assert result.get("errors") == {} - assert "flow_id" in result result = await hass.config_entries.options.async_configure( result["flow_id"], diff --git a/tests/components/whois/test_config_flow.py b/tests/components/whois/test_config_flow.py index 7250a9d1567..beda26c42d1 100644 --- a/tests/components/whois/test_config_flow.py +++ b/tests/components/whois/test_config_flow.py @@ -30,7 +30,6 @@ async def test_full_user_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -71,7 +70,6 @@ async def test_full_flow_with_error( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == SOURCE_USER - assert "flow_id" in result mock_whois_config_flow.side_effect = throw result2 = await hass.config_entries.flow.async_configure( @@ -82,7 +80,6 @@ async def test_full_flow_with_error( assert result2.get("type") == FlowResultType.FORM assert result2.get("step_id") == SOURCE_USER assert result2.get("errors") == {"base": reason} - assert "flow_id" in result2 assert len(mock_setup_entry.mock_calls) == 0 assert len(mock_whois_config_flow.mock_calls) == 1 diff --git a/tests/components/wled/test_config_flow.py b/tests/components/wled/test_config_flow.py index 600bf0eb0d2..0ba8e65942a 100644 --- a/tests/components/wled/test_config_flow.py +++ b/tests/components/wled/test_config_flow.py @@ -24,7 +24,6 @@ async def test_full_user_flow_implementation( assert result.get("step_id") == "user" assert result.get("type") == FlowResultType.FORM - assert "flow_id" in result result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={CONF_HOST: "192.168.1.123"} @@ -65,7 +64,6 @@ async def test_full_zeroconf_flow_implementation( assert result.get("description_placeholders") == {CONF_NAME: "WLED RGB Light"} assert result.get("step_id") == "zeroconf_confirm" assert result.get("type") == FlowResultType.FORM - assert "flow_id" in result result2 = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={} @@ -271,7 +269,6 @@ async def test_options_flow( assert result.get("type") == FlowResultType.FORM assert result.get("step_id") == "init" - assert "flow_id" in result result2 = await hass.config_entries.options.async_configure( result["flow_id"], diff --git a/tests/components/youless/test_config_flows.py b/tests/components/youless/test_config_flows.py index 5bf119681c4..08f38f8eb2c 100644 --- a/tests/components/youless/test_config_flows.py +++ b/tests/components/youless/test_config_flows.py @@ -28,7 +28,6 @@ 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 "flow_id" in result mock_youless = _get_mock_youless_api( initialize={"homes": [{"id": 1, "name": "myhome"}]} @@ -56,7 +55,6 @@ 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 "flow_id" in result mock_youless = _get_mock_youless_api(initialize=URLError("")) with patch( diff --git a/tests/components/zamg/test_config_flow.py b/tests/components/zamg/test_config_flow.py index 26939c07f0c..94931ab5d58 100644 --- a/tests/components/zamg/test_config_flow.py +++ b/tests/components/zamg/test_config_flow.py @@ -26,7 +26,6 @@ async def test_full_user_flow_implementation( assert result.get("type") == FlowResultType.FORM LOGGER.debug(result) assert result.get("data_schema") != "" - assert "flow_id" in result result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={CONF_STATION_ID: TEST_STATION_ID}, @@ -68,7 +67,6 @@ async def test_error_update( LOGGER.debug(result) assert result.get("data_schema") != "" mock_zamg.update.side_effect = ZamgApiError - assert "flow_id" in result result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={CONF_STATION_ID: TEST_STATION_ID}, @@ -105,7 +103,6 @@ async def test_user_flow_duplicate( assert result.get("step_id") == "user" assert result.get("type") == FlowResultType.FORM - assert "flow_id" in result result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={CONF_STATION_ID: TEST_STATION_ID}, @@ -143,7 +140,6 @@ async def test_import_flow_duplicate( assert result.get("step_id") == "user" assert result.get("type") == FlowResultType.FORM - assert "flow_id" in result result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={CONF_STATION_ID: TEST_STATION_ID}, @@ -176,7 +172,6 @@ async def test_import_flow_duplicate_after_position( assert result.get("step_id") == "user" assert result.get("type") == FlowResultType.FORM - assert "flow_id" in result result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={CONF_STATION_ID: TEST_STATION_ID},