Remove obihai YAMl configuration (#93549)

This commit is contained in:
G Johansson
2023-05-26 08:41:21 +02:00
committed by GitHub
parent 1f467fcc6a
commit af9ee8bc4a
4 changed files with 4 additions and 126 deletions
@@ -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."""