1
0
mirror of https://github.com/home-assistant/core.git synced 2026-06-02 21:54:27 +01:00
Files
core/tests/components/snooz/test_config.py
T
Austin Brunkhorst 7d097d18b0 Add support for Snooz BLE devices (#78790)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-10-10 13:14:27 -10:00

27 lines
892 B
Python

"""Test Snooz configuration."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from . import SnoozFixture
async def test_removing_entry_cleans_up_connections(
hass: HomeAssistant, mock_connected_snooz: SnoozFixture
):
"""Tests setup and removal of a config entry, ensuring connections are cleaned up."""
await hass.config_entries.async_remove(mock_connected_snooz.entry.entry_id)
await hass.async_block_till_done()
assert not mock_connected_snooz.device.is_connected
async def test_reloading_entry_cleans_up_connections(
hass: HomeAssistant, mock_connected_snooz: SnoozFixture
):
"""Test reloading an entry disconnects any existing connections."""
await hass.config_entries.async_reload(mock_connected_snooz.entry.entry_id)
await hass.async_block_till_done()
assert not mock_connected_snooz.device.is_connected