Ensure hue tests add config entry before updating it (#110428)

This commit is contained in:
J. Nick Koston 2024-02-12 21:59:26 -06:00 committed by GitHub
parent a51ecd0614
commit 704ad67917
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -14,6 +14,7 @@ async def test_migrate_api_key(hass: HomeAssistant) -> None:
domain=hue.DOMAIN,
data={"host": "0.0.0.0", "api_version": 2, "username": "abcdefgh"},
)
config_entry.add_to_hass(hass)
await hue.migration.check_migration(hass, config_entry)
# the username property should have been migrated to api_key
assert config_entry.data == {
@ -29,6 +30,7 @@ async def test_auto_switchover(hass: HomeAssistant) -> None:
domain=hue.DOMAIN,
data={"host": "0.0.0.0", "api_version": 1, "username": "abcdefgh"},
)
config_entry.add_to_hass(hass)
with patch.object(hue.migration, "is_v2_bridge", retun_value=True), patch.object(
hue.migration, "handle_v2_migration"