Mark required fields in FlowResult typedict (#84811)

* Mark required fields in FlowResult typedict

* Remove unneeded asserts from tests
This commit is contained in:
Franck Nijhof 2022-12-30 12:01:45 +01:00 committed by GitHub
parent f68a7636c5
commit bcf32f8331
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 3 additions and 145 deletions

View file

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