Skip to content

Commit

Permalink
Revert "Add options flow test"
Browse files Browse the repository at this point in the history
This reverts commit 33b0eae.
  • Loading branch information
dan-r committed Apr 13, 2024
1 parent 6cf3aa6 commit 13a8822
Showing 1 changed file with 3 additions and 33 deletions.
36 changes: 3 additions & 33 deletions tests/test_config_flow.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"""Tests for the config flow."""
from unittest import mock
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_NAME, CONF_PATH
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry

from custom_components.ohme import config_flow
from homeassistant.helpers import config_entry_flow
from custom_components.ohme.const import DOMAIN

async def test_step_account(hass):
"""Test the initialization of the form in the first step of the config flow."""
Expand All @@ -24,35 +26,3 @@ async def test_step_account(hass):
}

assert expected == result

async def test_options_flow(hass):
"""Test the options flow."""
entry = MockConfigEntry(domain=config_flow.DOMAIN)
entry.add_to_hass(hass)

flow = config_flow.OhmeOptionsFlow(entry)
result = await config_entry_flow.async_init(
hass, flow, context={"source": "test"}, data={}
)

assert result["type"] == "form"
assert result["step_id"] == "init"
assert result["data_schema"] is not None

result = await config_entry_flow.async_configure(
hass,
flow,
result["step_id"],
{
"email": "[email protected]",
"password": "password123",
"never_session_specific": True,
"enable_accumulative_energy": False,
},
)

assert result["type"] == "create_entry"
assert result["data"] == {
"never_session_specific": True,
"enable_accumulative_energy": False,
}

0 comments on commit 13a8822

Please sign in to comment.