Add EnergyZero integration (#83886)
This commit is contained in:
parent
38f183a683
commit
7d54620f34
20 changed files with 1029 additions and 0 deletions
32
tests/components/energyzero/test_config_flow.py
Normal file
32
tests/components/energyzero/test_config_flow.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue