hass-core/tests/components/justnimbus/test_init.py
Koen van Zuijlen acd07b4826
Fix for justnimbus integration (#99212)
* Fix for justnimbus integration

* Fixed tests and moved const

* fix: added reauth flow

* fix: fixed reauth config flow

* chore: added config_flow reauth test

* chore: Processed PR feedback

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-01-23 08:56:11 +01:00

21 lines
845 B
Python

"""Tests for JustNimbus initialization."""
from homeassistant.components.justnimbus.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from .conftest import FIXTURE_OLD_USER_INPUT, FIXTURE_UNIQUE_ID
from tests.common import MockConfigEntry
async def test_config_entry_reauth_at_setup(hass: HomeAssistant) -> None:
"""Test that setting up with old config results in reauth."""
mock_config = MockConfigEntry(
domain=DOMAIN, unique_id=FIXTURE_UNIQUE_ID, data=FIXTURE_OLD_USER_INPUT
)
mock_config.add_to_hass(hass)
await hass.config_entries.async_setup(mock_config.entry_id)
await hass.async_block_till_done()
assert mock_config.state is ConfigEntryState.SETUP_ERROR
assert any(mock_config.async_get_active_flows(hass, {"reauth"}))