Locally patch AirzoneLocalApi in tests (#68770)

pull/68775/head^2
Álvaro Fernández Rojas 2022-03-28 10:51:59 +02:00 committed by GitHub
parent 48187cebad
commit 67d3e84448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -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(

View File

@ -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)

View File

@ -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)