From fa5ce70af1f6cbc219adf49ae15730abf090482f Mon Sep 17 00:00:00 2001 From: Robert Svensson Date: Fri, 19 Mar 2021 13:37:22 +0100 Subject: [PATCH] Improve test coverage of deCONZ config flow (#48091) --- tests/components/deconz/test_config_flow.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/components/deconz/test_config_flow.py b/tests/components/deconz/test_config_flow.py index 19f544fabc9..8f9a597e00c 100644 --- a/tests/components/deconz/test_config_flow.py +++ b/tests/components/deconz/test_config_flow.py @@ -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)