hass-core/tests/components/airzone/test_init.py
Álvaro Fernández Rojas 542c3cbf90
Address late Airzone PR comments and fix Fahrenheit temperatures (#67904)
* airzone: address late PR comments

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone: fix fahrenheit temperatures

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone: add changes suggested by @MartinHjelmare

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2022-03-09 20:51:39 +01:00

31 lines
952 B
Python

"""Define tests for the Airzone init."""
from unittest.mock import patch
from homeassistant.components.airzone.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from .util import CONFIG, HVAC_MOCK
from tests.common import MockConfigEntry
async def test_unload_entry(hass):
"""Test unload."""
config_entry = MockConfigEntry(
domain=DOMAIN, unique_id="airzone_unique_id", data=CONFIG
)
config_entry.add_to_hass(hass)
with patch(
"aioairzone.localapi_device.AirzoneLocalApi.get_hvac",
return_value=HVAC_MOCK,
):
assert await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
assert config_entry.state is ConfigEntryState.LOADED
await hass.config_entries.async_unload(config_entry.entry_id)
await hass.async_block_till_done()
assert config_entry.state is ConfigEntryState.NOT_LOADED