hass-core/tests/components/met_eireann/test_init.py
Dylan Gore f3399aa8aa
Add a new weather integration - Met Éireann (#39429)
* Added a new weather integration - Met Éireann

* Fix codespell error

* Update met_eireann to use CoordinatorEntity

* Remove deprecated platform setup

* Fix merge conflict

* Remove unnecessary onboarding/home tracking code

* Use common strings for config flow

* Remove unnecessary code

* Switch to using unique IDs in config flow

* Use constants where possible

* Fix failing tests

* Fix isort errors

* Remove unnecessary DataUpdateCoordinator class

* Add device info

* Explicitly define forecast data

* Disable hourly forecast entity by default

* Update config flow to reflect requested changes

* Cleanup code

* Update entity naming to match other similar components

* Convert forecast time to UTC

* Fix test coverage

* Update test coverage

* Remove elevation conversion

* Update translations for additional clarity

* Remove en-GB translation
2021-04-05 23:23:57 +02:00

19 lines
647 B
Python

"""Test the Met Éireann integration init."""
from homeassistant.components.met_eireann.const import DOMAIN
from homeassistant.config_entries import ENTRY_STATE_LOADED, ENTRY_STATE_NOT_LOADED
from . import init_integration
async def test_unload_entry(hass):
"""Test successful unload of entry."""
entry = await init_integration(hass)
assert len(hass.config_entries.async_entries(DOMAIN)) == 1
assert entry.state == ENTRY_STATE_LOADED
assert await hass.config_entries.async_unload(entry.entry_id)
await hass.async_block_till_done()
assert entry.state == ENTRY_STATE_NOT_LOADED
assert not hass.data.get(DOMAIN)