mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 22:07:10 +00:00
Ensure blink tests add config entry before updating it (#110415)
This commit is contained in:
parent
a3a1f8216c
commit
b3d9e15fb4
@ -85,10 +85,10 @@ async def test_migrate_V0(
|
|||||||
mock_config_entry: MockConfigEntry,
|
mock_config_entry: MockConfigEntry,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test migration script version 0."""
|
"""Test migration script version 0."""
|
||||||
|
mock_config_entry.add_to_hass(hass)
|
||||||
|
|
||||||
hass.config_entries.async_update_entry(mock_config_entry, version=0)
|
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)
|
assert await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
entry = hass.config_entries.async_get_entry(mock_config_entry.entry_id)
|
entry = hass.config_entries.async_get_entry(mock_config_entry.entry_id)
|
||||||
@ -104,6 +104,7 @@ async def test_migrate(
|
|||||||
version,
|
version,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test migration scripts."""
|
"""Test migration scripts."""
|
||||||
|
mock_config_entry.add_to_hass(hass)
|
||||||
|
|
||||||
hass.config_entries.async_update_entry(
|
hass.config_entries.async_update_entry(
|
||||||
mock_config_entry,
|
mock_config_entry,
|
||||||
@ -111,7 +112,6 @@ async def test_migrate(
|
|||||||
data={**mock_config_entry.data, "login_response": "Blah"},
|
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)
|
assert not await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
entry = hass.config_entries.async_get_entry(mock_config_entry.entry_id)
|
entry = hass.config_entries.async_get_entry(mock_config_entry.entry_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user