1
0
mirror of https://github.com/home-assistant/core.git synced 2026-06-09 00:47:04 +01:00
Files
core/tests/components/prusalink/test_init.py
T
Paulus Schoutsen 481205535c Add PrusaLink integration (#77429)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-08-29 20:45:27 -04:00

24 lines
744 B
Python

"""Test setting up and unloading PrusaLink."""
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
from homeassistant.core import HomeAssistant
async def test_sensors_no_job(
hass: HomeAssistant,
mock_config_entry: ConfigEntry,
mock_api,
):
"""Test sensors while no job active."""
assert await hass.config_entries.async_setup(mock_config_entry.entry_id)
assert mock_config_entry.state == ConfigEntryState.LOADED
assert hass.states.async_entity_ids_count() > 0
assert await hass.config_entries.async_unload(mock_config_entry.entry_id)
assert mock_config_entry.state == ConfigEntryState.NOT_LOADED
for state in hass.states.async_all():
assert state.state == "unavailable"