Remove incorrect constant usage in test (#91198)

This commit is contained in:
epenet 2023-04-11 10:00:17 +02:00 committed by GitHub
parent 2f7c5a56eb
commit 7b3a932cd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 85 additions and 87 deletions

View file

@ -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:

View file

@ -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(

View file

@ -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(

View file

@ -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]

View file

@ -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

View file

@ -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:

View file

@ -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

View file

@ -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__",

View file

@ -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:

View file

@ -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:

View file

@ -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"],

View file

@ -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(

View file

@ -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(

View file

@ -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",

View file

@ -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}

View file

@ -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(

View file

@ -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"],

View file

@ -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:

View file

@ -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:

View file

@ -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"],

View file

@ -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(

View file

@ -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

View file

@ -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"],

View file

@ -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

View file

@ -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"],

View file

@ -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(

View file

@ -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(

View file

@ -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"],

View file

@ -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(

View file

@ -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"

View file

@ -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:

View file

@ -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(

View file

@ -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

View file

@ -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(

View file

@ -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

View file

@ -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"],

View file

@ -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

View file

@ -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(

View file

@ -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",

View file

@ -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

View file

@ -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()

View file

@ -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"}

View file

@ -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()

View file

@ -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"],

View file

@ -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",

View file

@ -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

View file

@ -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(