Ensure blink tests add config entry before updating it (#110415)

pull/110441/head^2
J. Nick Koston 2024-02-12 15:56:22 -06:00 committed by GitHub
parent a3a1f8216c
commit b3d9e15fb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -85,10 +85,10 @@ async def test_migrate_V0(
mock_config_entry: MockConfigEntry,
) -> None:
"""Test migration script version 0."""
mock_config_entry.add_to_hass(hass)
hass.config_entries.async_update_entry(mock_config_entry, version=0)
mock_config_entry.add_to_hass(hass)
assert await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entry = hass.config_entries.async_get_entry(mock_config_entry.entry_id)
@ -104,6 +104,7 @@ async def test_migrate(
version,
) -> None:
"""Test migration scripts."""
mock_config_entry.add_to_hass(hass)
hass.config_entries.async_update_entry(
mock_config_entry,
@ -111,7 +112,6 @@ async def test_migrate(
data={**mock_config_entry.data, "login_response": "Blah"},
)
mock_config_entry.add_to_hass(hass)
assert not await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entry = hass.config_entries.async_get_entry(mock_config_entry.entry_id)