Improve test coverage of deCONZ config flow (#48091)

This commit is contained in:
Robert Svensson 2021-03-19 13:37:22 +01:00 committed by GitHub
parent 6e0c0afde2
commit fa5ce70af1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -442,6 +442,18 @@ async def test_flow_ssdp_discovery(hass, aioclient_mock):
}
async def test_flow_ssdp_bad_discovery(hass, aioclient_mock):
"""Test that SSDP discovery aborts if manufacturer URL is wrong."""
result = await hass.config_entries.flow.async_init(
DECONZ_DOMAIN,
data={ATTR_UPNP_MANUFACTURER_URL: "other"},
context={"source": SOURCE_SSDP},
)
assert result["type"] == RESULT_TYPE_ABORT
assert result["reason"] == "not_deconz_bridge"
async def test_ssdp_discovery_update_configuration(hass, aioclient_mock):
"""Test if a discovered bridge is configured but updates with new attributes."""
config_entry = await setup_deconz_integration(hass, aioclient_mock)