mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Full test coverage for Vodafone Station init (#139451)
Full test coverage for Vodafone Station init
This commit is contained in:
parent
df006aeade
commit
8cc7e7b76f
33
tests/components/vodafone_station/test_init.py
Normal file
33
tests/components/vodafone_station/test_init.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
"""Tests for Vodafone Station init."""
|
||||||
|
|
||||||
|
from unittest.mock import AsyncMock
|
||||||
|
|
||||||
|
from homeassistant.components.device_tracker import CONF_CONSIDER_HOME
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.data_entry_flow import FlowResultType
|
||||||
|
|
||||||
|
from . import setup_integration
|
||||||
|
|
||||||
|
from tests.common import MockConfigEntry
|
||||||
|
|
||||||
|
|
||||||
|
async def test_reload_config_entry_with_options(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
mock_vodafone_station_router: AsyncMock,
|
||||||
|
mock_config_entry: MockConfigEntry,
|
||||||
|
) -> None:
|
||||||
|
"""Test the the config entry is reloaded with options."""
|
||||||
|
await setup_integration(hass, mock_config_entry)
|
||||||
|
|
||||||
|
result = await hass.config_entries.options.async_init(mock_config_entry.entry_id)
|
||||||
|
result = await hass.config_entries.options.async_configure(
|
||||||
|
result["flow_id"],
|
||||||
|
user_input={
|
||||||
|
CONF_CONSIDER_HOME: 37,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
assert result["type"] is FlowResultType.CREATE_ENTRY
|
||||||
|
assert result["data"] == {
|
||||||
|
CONF_CONSIDER_HOME: 37,
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user