Ensure hue tests add config entry before updating it (#110428)
This commit is contained in:
parent
a51ecd0614
commit
704ad67917
2 changed files with 3 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue