mirror of
https://github.com/home-assistant/core.git
synced 2026-09-27 09:58:07 -04:00
Remove obihai YAMl configuration (#93549)
This commit is contained in:
@@ -78,54 +78,6 @@ async def test_connect_failure(hass: HomeAssistant, mock_gaierror: Generator) ->
|
||||
assert result["errors"]["base"] == "cannot_connect"
|
||||
|
||||
|
||||
async def test_yaml_import(hass: HomeAssistant) -> None:
|
||||
"""Test we get the YAML imported."""
|
||||
|
||||
with patch(VALIDATE_AUTH_PATCH, return_value=MockPyObihai()):
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_IMPORT},
|
||||
data=USER_INPUT,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert "errors" not in result
|
||||
|
||||
|
||||
async def test_yaml_import_auth_fail(hass: HomeAssistant) -> None:
|
||||
"""Test the YAML import fails."""
|
||||
|
||||
with patch(VALIDATE_AUTH_PATCH, return_value=False):
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_IMPORT},
|
||||
data=USER_INPUT,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result["type"] == FlowResultType.ABORT
|
||||
assert result["reason"] == "invalid_auth"
|
||||
assert "errors" not in result
|
||||
|
||||
|
||||
async def test_yaml_import_connect_fail(
|
||||
hass: HomeAssistant, mock_gaierror: Generator
|
||||
) -> None:
|
||||
"""Test the YAML import fails with invalid host."""
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_IMPORT},
|
||||
data=USER_INPUT,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result["type"] == FlowResultType.ABORT
|
||||
assert result["reason"] == "cannot_connect"
|
||||
assert "errors" not in result
|
||||
|
||||
|
||||
async def test_dhcp_flow(hass: HomeAssistant) -> None:
|
||||
"""Test that DHCP discovery works."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user