mirror of
https://github.com/home-assistant/core.git
synced 2026-11-23 14:17:19 -04:00
Launch Library: remove deprecated YAML import (#69008)
This commit is contained in:
@@ -3,29 +3,11 @@ from unittest.mock import patch
|
||||
|
||||
from homeassistant import data_entry_flow
|
||||
from homeassistant.components.launch_library.const import DOMAIN
|
||||
from homeassistant.components.launch_library.sensor import DEFAULT_NEXT_LAUNCH_NAME
|
||||
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER
|
||||
from homeassistant.const import CONF_NAME
|
||||
from homeassistant.config_entries import SOURCE_USER
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
async def test_import(hass):
|
||||
"""Test entry will be imported."""
|
||||
|
||||
imported_config = {CONF_NAME: DEFAULT_NEXT_LAUNCH_NAME}
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.launch_library.async_setup_entry", return_value=True
|
||||
):
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_IMPORT}, data=imported_config
|
||||
)
|
||||
assert result.get("type") == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result.get("result").data == imported_config
|
||||
|
||||
|
||||
async def test_create_entry(hass):
|
||||
"""Test we can finish a config flow."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user