Netgear ssdp discovery abort if no serial (#87532)

fixes undefined
This commit is contained in:
starkillerOG
2023-02-08 15:38:44 -06:00
committed by GitHub
parent 014743a27c
commit 0ab30ece68
3 changed files with 25 additions and 1 deletions
@@ -236,6 +236,25 @@ async def test_ssdp_already_configured(hass: HomeAssistant) -> None:
assert result["reason"] == "already_configured"
async def test_ssdp_no_serial(hass: HomeAssistant) -> None:
"""Test ssdp abort when the ssdp info does not include a serial number."""
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_SSDP},
data=ssdp.SsdpServiceInfo(
ssdp_usn="mock_usn",
ssdp_st="mock_st",
ssdp_location=SSDP_URL,
upnp={
ssdp.ATTR_UPNP_MODEL_NUMBER: "RBR20",
ssdp.ATTR_UPNP_PRESENTATION_URL: URL,
},
),
)
assert result["type"] == data_entry_flow.FlowResultType.ABORT
assert result["reason"] == "no_serial"
async def test_ssdp_ipv6(hass: HomeAssistant) -> None:
"""Test ssdp abort when using a ipv6 address."""
MockConfigEntry(