mirror of
https://github.com/home-assistant/core.git
synced 2026-09-26 17:31:15 -04:00
Remove deprecated yaml import for Russound RIO (#134072)
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
from unittest.mock import AsyncMock
|
||||
|
||||
from homeassistant.components.russound_rio.const import DOMAIN
|
||||
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER, ConfigFlowResult
|
||||
from homeassistant.config_entries import SOURCE_USER, ConfigFlowResult
|
||||
from homeassistant.const import CONF_HOST, CONF_PORT
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.data_entry_flow import FlowResultType
|
||||
@@ -89,37 +89,6 @@ async def test_duplicate(
|
||||
assert result["reason"] == "already_configured"
|
||||
|
||||
|
||||
async def test_import(
|
||||
hass: HomeAssistant, mock_setup_entry: AsyncMock, mock_russound_client: AsyncMock
|
||||
) -> None:
|
||||
"""Test we import a config entry."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": SOURCE_IMPORT},
|
||||
data=MOCK_CONFIG,
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.CREATE_ENTRY
|
||||
assert result["title"] == MODEL
|
||||
assert result["data"] == MOCK_CONFIG
|
||||
assert len(mock_setup_entry.mock_calls) == 1
|
||||
assert result["result"].unique_id == "00:11:22:33:44:55"
|
||||
|
||||
|
||||
async def test_import_cannot_connect(
|
||||
hass: HomeAssistant, mock_russound_client: AsyncMock
|
||||
) -> None:
|
||||
"""Test we handle import cannot connect error."""
|
||||
mock_russound_client.connect.side_effect = TimeoutError
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_IMPORT}, data=MOCK_CONFIG
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.ABORT
|
||||
assert result["reason"] == "cannot_connect"
|
||||
|
||||
|
||||
async def _start_reconfigure_flow(
|
||||
hass: HomeAssistant, mock_config_entry: MockConfigEntry
|
||||
) -> ConfigFlowResult:
|
||||
|
||||
Reference in New Issue
Block a user