mirror of
https://github.com/home-assistant/core.git
synced 2026-02-24 11:57:05 +00:00
Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
30 lines
946 B
Python
30 lines
946 B
Python
"""Test the MTA New York City Transit init."""
|
|
|
|
from unittest.mock import MagicMock
|
|
|
|
from homeassistant.components.mta.const import DOMAIN
|
|
from homeassistant.config_entries import ConfigEntryState
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
async def test_setup_and_unload_entry(
|
|
hass: HomeAssistant,
|
|
mock_config_entry: MockConfigEntry,
|
|
mock_subway_feed: MagicMock,
|
|
) -> None:
|
|
"""Test setting up and unloading an entry."""
|
|
mock_config_entry.add_to_hass(hass)
|
|
|
|
assert await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
|
await hass.async_block_till_done()
|
|
|
|
assert mock_config_entry.state is ConfigEntryState.LOADED
|
|
assert DOMAIN in hass.config_entries.async_domains()
|
|
|
|
assert await hass.config_entries.async_unload(mock_config_entry.entry_id)
|
|
await hass.async_block_till_done()
|
|
|
|
assert mock_config_entry.state is ConfigEntryState.NOT_LOADED
|