Add EnergyZero integration (#83886)

This commit is contained in:
Klaas Schoute 2023-01-03 22:28:16 +01:00 committed by GitHub
parent 38f183a683
commit 7d54620f34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1029 additions and 0 deletions

View file

@ -0,0 +1,32 @@
"""Test the EnergyZero config flow."""
from unittest.mock import MagicMock
from homeassistant.components.energyzero.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResultType
async def test_full_user_flow(
hass: HomeAssistant,
mock_setup_entry: MagicMock,
) -> None:
"""Test the full user configuration flow."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}
)
assert result.get("type") == FlowResultType.FORM
assert result.get("step_id") == SOURCE_USER
assert "flow_id" in result
result2 = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input={},
)
assert result2.get("type") == FlowResultType.CREATE_ENTRY
assert result2.get("title") == "EnergyZero"
assert result2.get("data") == {}
assert len(mock_setup_entry.mock_calls) == 1