33 lines
946 B
Python
33 lines
946 B
Python
|
"""Tests for the ccm15 component."""
|
||
|
from unittest.mock import AsyncMock
|
||
|
|
||
|
from homeassistant.components.ccm15.const import DOMAIN
|
||
|
from homeassistant.config_entries import ConfigEntryState
|
||
|
from homeassistant.const import CONF_HOST, CONF_PORT
|
||
|
from homeassistant.core import HomeAssistant
|
||
|
|
||
|
from tests.common import MockConfigEntry
|
||
|
|
||
|
|
||
|
async def test_load_unload(hass: HomeAssistant, ccm15_device: AsyncMock) -> None:
|
||
|
"""Test options flow."""
|
||
|
entry = MockConfigEntry(
|
||
|
domain=DOMAIN,
|
||
|
unique_id="1.1.1.1",
|
||
|
data={
|
||
|
CONF_HOST: "1.1.1.1",
|
||
|
CONF_PORT: 80,
|
||
|
},
|
||
|
)
|
||
|
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
|
||
|
|
||
|
await hass.config_entries.async_unload(entry.entry_id)
|
||
|
await hass.async_block_till_done()
|
||
|
|
||
|
assert entry.state is ConfigEntryState.NOT_LOADED
|