mirror of
https://github.com/home-assistant/core.git
synced 2025-04-27 10:47:51 +00:00
26 lines
862 B
Python
26 lines
862 B
Python
"""Tests for the Rova integration init."""
|
|
|
|
from unittest.mock import MagicMock
|
|
|
|
from homeassistant.config_entries import ConfigEntryState
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers import issue_registry as ir
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
async def test_issue_if_not_rova_area(
|
|
hass: HomeAssistant,
|
|
mock_rova: MagicMock,
|
|
mock_config_entry: MockConfigEntry,
|
|
issue_registry: ir.IssueRegistry,
|
|
) -> None:
|
|
"""Test we create an issue if rova does not collect at the given address."""
|
|
mock_rova.is_rova_area.return_value = False
|
|
mock_config_entry.add_to_hass(hass)
|
|
assert not await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
|
await hass.async_block_till_done()
|
|
|
|
assert mock_config_entry.state == ConfigEntryState.SETUP_ERROR
|
|
assert len(issue_registry.issues) == 1
|