Add show progress to ozw config flow (#43310)

This commit is contained in:
Martin Hjelmare 2020-11-30 18:59:15 +01:00 committed by GitHub
parent 7ad2a6be30
commit 3f5d7e85c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 4 deletions

View file

@ -305,6 +305,16 @@ async def test_addon_not_installed(
result["flow_id"], {"use_addon": True}
)
assert result["type"] == "progress"
# Make sure the flow continues when the progress task is done.
await hass.async_block_till_done()
result = await hass.config_entries.flow.async_configure(result["flow_id"])
assert result["type"] == "form"
assert result["step_id"] == "start_addon"
with patch(
"homeassistant.components.ozw.async_setup", return_value=True
) as mock_setup, patch(
@ -342,5 +352,12 @@ async def test_install_addon_failure(hass, supervisor, addon_installed, install_
result["flow_id"], {"use_addon": True}
)
assert result["type"] == "progress"
# Make sure the flow continues when the progress task is done.
await hass.async_block_till_done()
result = await hass.config_entries.flow.async_configure(result["flow_id"])
assert result["type"] == "abort"
assert result["reason"] == "addon_install_failed"