Skip to content

Commit

Permalink
Use get_hacs helper in config_flow test (#3598)
Browse files Browse the repository at this point in the history
* Use get_hacs helper in config_flow test

* Add missing hass argument

---------

Co-authored-by: ludeeus <[email protected]>
Co-authored-by: Joakim Sørensen <[email protected]>
  • Loading branch information
3 people authored Apr 11, 2024
1 parent 77731d9 commit 4aaf65d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
MockedResponse,
ResponseMocker,
create_config_entry,
get_hacs,
recursive_remove_key,
safe_json_dumps,
)
Expand Down Expand Up @@ -292,16 +293,15 @@ async def test_already_configured(
)


async def test_options_flow(
hass: HomeAssistant, setup_integration: Generator, hacs: HacsBase
) -> None:
async def test_options_flow(hass: HomeAssistant, setup_integration: Generator) -> None:
"""Test reconfiguring."""
config_entry = hass.config_entries.async_entries(DOMAIN)[0]
result = await hass.config_entries.options.async_init(config_entry.entry_id)
assert result["type"] == FlowResultType.FORM
assert result["step_id"] == "user"

# Test defaults
hacs = get_hacs(hass)
schema = result["data_schema"].schema
for key in schema:
assert key.default() == getattr(hacs.configuration, str(key))
Expand Down Expand Up @@ -337,7 +337,7 @@ async def test_options_flow(

# Check config entry is reloaded with new options
await hass.async_block_till_done()
hacs = hass.data[DOMAIN]

# Get a new HACS instance after reload
hacs = get_hacs(hass)
for key, val in config_entry.options.items():
assert getattr(hacs.configuration, str(key)) == val

0 comments on commit 4aaf65d

Please sign in to comment.