mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Remove deprecated YAML configuration from Abode (#52357)
This commit is contained in:
@@ -7,7 +7,7 @@ from abodepy.helpers.errors import MFA_CODE_REQUIRED
|
||||
from homeassistant import data_entry_flow
|
||||
from homeassistant.components.abode import config_flow
|
||||
from homeassistant.components.abode.const import DOMAIN
|
||||
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_REAUTH, SOURCE_USER
|
||||
from homeassistant.config_entries import SOURCE_REAUTH, SOURCE_USER
|
||||
from homeassistant.const import (
|
||||
CONF_PASSWORD,
|
||||
CONF_USERNAME,
|
||||
@@ -46,17 +46,6 @@ async def test_one_config_allowed(hass):
|
||||
assert step_user_result["type"] == data_entry_flow.RESULT_TYPE_ABORT
|
||||
assert step_user_result["reason"] == "single_instance_allowed"
|
||||
|
||||
conf = {
|
||||
CONF_USERNAME: "user@email.com",
|
||||
CONF_PASSWORD: "password",
|
||||
CONF_POLLING: False,
|
||||
}
|
||||
|
||||
import_config_result = await flow.async_step_import(conf)
|
||||
|
||||
assert import_config_result["type"] == data_entry_flow.RESULT_TYPE_ABORT
|
||||
assert import_config_result["reason"] == "single_instance_allowed"
|
||||
|
||||
|
||||
async def test_invalid_credentials(hass):
|
||||
"""Test that invalid credentials throws an error."""
|
||||
@@ -90,29 +79,6 @@ async def test_connection_error(hass):
|
||||
assert result["errors"] == {"base": "cannot_connect"}
|
||||
|
||||
|
||||
async def test_step_import(hass):
|
||||
"""Test that the import step works."""
|
||||
conf = {
|
||||
CONF_USERNAME: "user@email.com",
|
||||
CONF_PASSWORD: "password",
|
||||
CONF_POLLING: False,
|
||||
}
|
||||
|
||||
with patch("homeassistant.components.abode.config_flow.Abode"), patch(
|
||||
"abodepy.UTILS"
|
||||
):
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_IMPORT}, data=conf
|
||||
)
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result["title"] == "user@email.com"
|
||||
assert result["data"] == {
|
||||
CONF_USERNAME: "user@email.com",
|
||||
CONF_PASSWORD: "password",
|
||||
CONF_POLLING: False,
|
||||
}
|
||||
|
||||
|
||||
async def test_step_user(hass):
|
||||
"""Test that the user step works."""
|
||||
conf = {CONF_USERNAME: "user@email.com", CONF_PASSWORD: "password"}
|
||||
|
||||
Reference in New Issue
Block a user