Locally patch AirzoneLocalApi in tests (#68770)
parent
48187cebad
commit
67d3e84448
|
@ -21,7 +21,7 @@ async def test_form(hass):
|
|||
"homeassistant.components.airzone.async_setup_entry",
|
||||
return_value=True,
|
||||
) as mock_setup_entry, patch(
|
||||
"aioairzone.localapi_device.AirzoneLocalApi.get_hvac",
|
||||
"homeassistant.components.airzone.AirzoneLocalApi.get_hvac",
|
||||
return_value=HVAC_MOCK,
|
||||
):
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
|
@ -57,7 +57,7 @@ async def test_form_duplicated_id(hass):
|
|||
entry.add_to_hass(hass)
|
||||
|
||||
with patch(
|
||||
"aioairzone.localapi_device.AirzoneLocalApi.get_hvac",
|
||||
"homeassistant.components.airzone.AirzoneLocalApi.get_hvac",
|
||||
return_value=HVAC_MOCK,
|
||||
):
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
|
@ -72,7 +72,7 @@ async def test_connection_error(hass):
|
|||
"""Test connection to host error."""
|
||||
|
||||
with patch(
|
||||
"aioairzone.localapi_device.AirzoneLocalApi.validate_airzone",
|
||||
"homeassistant.components.airzone.AirzoneLocalApi.validate_airzone",
|
||||
side_effect=ClientConnectorError(MagicMock(), MagicMock()),
|
||||
):
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
|
|
|
@ -19,7 +19,7 @@ async def test_unload_entry(hass):
|
|||
config_entry.add_to_hass(hass)
|
||||
|
||||
with patch(
|
||||
"aioairzone.localapi_device.AirzoneLocalApi.get_hvac",
|
||||
"homeassistant.components.airzone.AirzoneLocalApi.get_hvac",
|
||||
return_value=HVAC_MOCK,
|
||||
):
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
|
|
|
@ -157,7 +157,7 @@ async def async_init_integration(
|
|||
entry.add_to_hass(hass)
|
||||
|
||||
with patch(
|
||||
"aioairzone.localapi_device.AirzoneLocalApi.get_hvac",
|
||||
"homeassistant.components.airzone.AirzoneLocalApi.get_hvac",
|
||||
return_value=HVAC_MOCK,
|
||||
):
|
||||
await hass.config_entries.async_setup(entry.entry_id)
|
||||
|
|
Loading…
Reference in New Issue