1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Clean up alarmdecoder (#52517)

* Clean up alarmdecoder

* fix

* try again

* tweak
This commit is contained in:
Robert Hillis
2021-07-06 10:18:00 -04:00
committed by GitHub
parent 07bda0973e
commit 6e779855f7
5 changed files with 65 additions and 153 deletions

View File

@@ -126,6 +126,16 @@ async def test_setup_connection_error(hass: HomeAssistant):
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["errors"] == {"base": "cannot_connect"}
with patch(
"homeassistant.components.alarmdecoder.config_flow.AdExt.open",
side_effect=Exception,
), patch("homeassistant.components.alarmdecoder.config_flow.AdExt.close"):
result = await hass.config_entries.flow.async_configure(
result["flow_id"], connection_settings
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["errors"] == {"base": "unknown"}
async def test_options_arm_flow(hass: HomeAssistant):
"""Test arm options flow."""