core/tests/components/holiday/test_init.py

30 lines
854 B
Python

"""Tests for the Holiday integration."""
from homeassistant.components.holiday.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
MOCK_CONFIG_DATA = {
"country": "Germany",
"province": "BW",
}
async def test_unload_entry(hass: HomeAssistant) -> None:
"""Test removing integration."""
entry = MockConfigEntry(domain=DOMAIN, data=MOCK_CONFIG_DATA)
entry.add_to_hass(hass)
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
assert entry.state is ConfigEntryState.LOADED
assert await hass.config_entries.async_unload(entry.entry_id)
await hass.async_block_till_done()
state: ConfigEntryState = entry.state
assert state is ConfigEntryState.NOT_LOADED