hass-core/tests/components/litejet/test_init.py
Jon Caruana 6a8b5ee51b
LiteJet is now configured using config_flow (#44409)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-02-23 14:20:58 -06:00

30 lines
987 B
Python

"""The tests for the litejet component."""
from homeassistant.components import litejet
from homeassistant.components.litejet.const import DOMAIN
from homeassistant.const import CONF_PORT
from homeassistant.setup import async_setup_component
from . import async_init_integration
async def test_setup_with_no_config(hass):
"""Test that nothing happens."""
assert await async_setup_component(hass, DOMAIN, {}) is True
assert DOMAIN not in hass.data
async def test_setup_with_config_to_import(hass, mock_litejet):
"""Test that import happens."""
assert (
await async_setup_component(hass, DOMAIN, {DOMAIN: {CONF_PORT: "/dev/hello"}})
is True
)
assert DOMAIN in hass.data
async def test_unload_entry(hass, mock_litejet):
"""Test being able to unload an entry."""
entry = await async_init_integration(hass, use_switch=True, use_scene=True)
assert await litejet.async_unload_entry(hass, entry)
assert DOMAIN not in hass.data