mirror of
https://github.com/home-assistant/core.git
synced 2026-12-03 04:08:19 -04:00
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
30 lines
993 B
Python
30 lines
993 B
Python
"""Tests for the Version integration setup."""
|
|
|
|
from pytest_homeassistant.common import MockConfigEntry
|
|
|
|
from homeassistant.components.version.const import CONF_BOARD, DEFAULT_CONFIGURATION
|
|
from homeassistant.config_entries import ConfigEntryState
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .common import MOCK_VERSION_CONFIG_ENTRY_DATA
|
|
|
|
|
|
async def test_setup_invalid_board(hass: HomeAssistant) -> None:
|
|
"""Test setup fails when the configured board is no longer valid."""
|
|
entry = MockConfigEntry(
|
|
**{
|
|
**MOCK_VERSION_CONFIG_ENTRY_DATA,
|
|
"data": {**DEFAULT_CONFIGURATION, CONF_BOARD: "Not a board"},
|
|
}
|
|
)
|
|
entry.add_to_hass(hass)
|
|
|
|
await hass.config_entries.async_setup(entry.entry_id)
|
|
await hass.async_block_till_done()
|
|
|
|
assert entry.state is ConfigEntryState.SETUP_ERROR
|
|
assert entry.reason == (
|
|
'Board "Not a board" is (no longer) valid. Please remove the integration'
|
|
' "Local installation"'
|
|
)
|