Migrate roku to use async_update_entry to alter config entries (#110363)
parent
e27e799dd5
commit
32e3f6c5a7
|
@ -87,8 +87,10 @@ async def init_integration(
|
||||||
mock_roku: MagicMock,
|
mock_roku: MagicMock,
|
||||||
) -> MockConfigEntry:
|
) -> MockConfigEntry:
|
||||||
"""Set up the Roku integration for testing."""
|
"""Set up the Roku integration for testing."""
|
||||||
mock_config_entry.unique_id = mock_device.info.serial_number
|
|
||||||
mock_config_entry.add_to_hass(hass)
|
mock_config_entry.add_to_hass(hass)
|
||||||
|
hass.config_entries.async_update_entry(
|
||||||
|
mock_config_entry, unique_id=mock_device.info.serial_number
|
||||||
|
)
|
||||||
|
|
||||||
await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
|
@ -32,8 +32,8 @@ async def test_config_entry_no_unique_id(
|
||||||
mock_roku: AsyncMock,
|
mock_roku: AsyncMock,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test the Roku configuration entry with missing unique id."""
|
"""Test the Roku configuration entry with missing unique id."""
|
||||||
mock_config_entry.unique_id = None
|
|
||||||
mock_config_entry.add_to_hass(hass)
|
mock_config_entry.add_to_hass(hass)
|
||||||
|
hass.config_entries.async_update_entry(mock_config_entry, unique_id=None)
|
||||||
await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue