24 lines
744 B
Python
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"
|