mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 21:55:10 +02:00
fix zeroconf tests
This commit is contained in:
@@ -542,7 +542,7 @@ async def test_homekit_match_partial_space(hass, mock_async_zeroconf):
|
||||
clear=True,
|
||||
), patch.dict(
|
||||
zc_gen.HOMEKIT,
|
||||
{"LIFX": "lifx"},
|
||||
{"LIFX": {"domain": "lifx", "iot_class": "local_polling"}},
|
||||
clear=True,
|
||||
), patch.object(
|
||||
hass.config_entries.flow, "async_init"
|
||||
@@ -578,7 +578,7 @@ async def test_device_with_invalid_name(hass, mock_async_zeroconf, caplog):
|
||||
clear=True,
|
||||
), patch.dict(
|
||||
zc_gen.HOMEKIT,
|
||||
{"LIFX": "lifx"},
|
||||
{"LIFX": {"domain": "lifx", "iot_class": "local_polling"}},
|
||||
clear=True,
|
||||
), patch.object(
|
||||
hass.config_entries.flow, "async_init"
|
||||
@@ -609,7 +609,7 @@ async def test_homekit_match_partial_dash(hass, mock_async_zeroconf):
|
||||
clear=True,
|
||||
), patch.dict(
|
||||
zc_gen.HOMEKIT,
|
||||
{"Smart Bridge": "lutron_caseta"},
|
||||
{"Smart Bridge": {"domain": "lutron_caseta", "iot_class": "local_push"}},
|
||||
clear=True,
|
||||
), patch.object(
|
||||
hass.config_entries.flow, "async_init"
|
||||
@@ -638,7 +638,11 @@ async def test_homekit_match_partial_fnmatch(hass, mock_async_zeroconf):
|
||||
zc_gen.ZEROCONF,
|
||||
{"_hap._tcp.local.": [{"domain": "homekit_controller"}]},
|
||||
clear=True,
|
||||
), patch.dict(zc_gen.HOMEKIT, {"YLDP*": "yeelight"}, clear=True), patch.object(
|
||||
), patch.dict(
|
||||
zc_gen.HOMEKIT,
|
||||
{"YLDP*": {"domain": "yeelight", "iot_class": "local_push"}},
|
||||
clear=True,
|
||||
), patch.object(
|
||||
hass.config_entries.flow, "async_init"
|
||||
) as mock_config_flow, patch.object(
|
||||
zeroconf,
|
||||
@@ -667,7 +671,7 @@ async def test_homekit_match_full(hass, mock_async_zeroconf):
|
||||
clear=True,
|
||||
), patch.dict(
|
||||
zc_gen.HOMEKIT,
|
||||
{"BSB002": "hue"},
|
||||
{"BSB002": {"domain": "hue", "iot_class": "local_push"}},
|
||||
clear=True,
|
||||
), patch.object(
|
||||
hass.config_entries.flow, "async_init"
|
||||
@@ -698,7 +702,10 @@ async def test_homekit_already_paired(hass, mock_async_zeroconf):
|
||||
clear=True,
|
||||
), patch.dict(
|
||||
zc_gen.HOMEKIT,
|
||||
{"AC02": "tado", "tado": "tado"},
|
||||
{
|
||||
"AC02": {"domain": "tado", "iot_class": "cloud_polling"},
|
||||
"tado": {"domain": "tado", "iot_class": "cloud_polling"},
|
||||
},
|
||||
clear=True,
|
||||
), patch.object(
|
||||
hass.config_entries.flow, "async_init"
|
||||
@@ -730,7 +737,7 @@ async def test_homekit_invalid_paring_status(hass, mock_async_zeroconf):
|
||||
clear=True,
|
||||
), patch.dict(
|
||||
zc_gen.HOMEKIT,
|
||||
{"Smart Bridge": "lutron_caseta"},
|
||||
{"Smart Bridge": {"domain": "lutron_caseta", "iot_class": "local_push"}},
|
||||
clear=True,
|
||||
), patch.object(
|
||||
hass.config_entries.flow, "async_init"
|
||||
@@ -794,7 +801,7 @@ async def test_homekit_controller_still_discovered_unpaired_for_cloud(
|
||||
clear=True,
|
||||
), patch.dict(
|
||||
zc_gen.HOMEKIT,
|
||||
{"Rachio": "rachio"},
|
||||
{"Rachio": {"domain": "rachio", "iot_class": "cloud_push"}},
|
||||
clear=True,
|
||||
), patch.object(
|
||||
hass.config_entries.flow, "async_init"
|
||||
@@ -834,7 +841,7 @@ async def test_homekit_controller_still_discovered_unpaired_for_polling(
|
||||
clear=True,
|
||||
), patch.dict(
|
||||
zc_gen.HOMEKIT,
|
||||
{"iSmartGate": "gogogate2"},
|
||||
{"iSmartGate": {"domain": "gogogate2", "iot_class": "local_polling"}},
|
||||
clear=True,
|
||||
), patch.object(
|
||||
hass.config_entries.flow, "async_init"
|
||||
|
@@ -623,8 +623,8 @@ async def test_get_homekit(hass: HomeAssistant) -> None:
|
||||
"test_2": test_2_integration,
|
||||
}
|
||||
homekit = await loader.async_get_homekit(hass)
|
||||
assert homekit["test_1"] == "test_1"
|
||||
assert homekit["test_2"] == "test_2"
|
||||
assert homekit["test_1"] == loader.HomeKitDiscoveredIntegration("test_1", None)
|
||||
assert homekit["test_2"] == loader.HomeKitDiscoveredIntegration("test_2", None)
|
||||
|
||||
|
||||
async def test_get_ssdp(hass: HomeAssistant) -> None:
|
||||
|
Reference in New Issue
Block a user