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

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