mirror of
https://github.com/home-assistant/core.git
synced 2026-09-25 17:04:04 -04:00
Use runtime_data for roku (#132781)
* use runtime_data for roku * unload cleanup * tweaks * tweaks * fix tests * fix tests * Update config_flow.py * Update config_flow.py
This commit is contained in:
@@ -4,7 +4,6 @@ from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
from rokuecp import RokuConnectionError
|
||||
|
||||
from homeassistant.components.roku.const import DOMAIN
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
@@ -38,12 +37,7 @@ async def test_config_entry_no_unique_id(
|
||||
await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert mock_config_entry.entry_id in hass.data[DOMAIN]
|
||||
assert mock_config_entry.state is ConfigEntryState.LOADED
|
||||
assert (
|
||||
hass.data[DOMAIN][mock_config_entry.entry_id].device_id
|
||||
== mock_config_entry.entry_id
|
||||
)
|
||||
|
||||
|
||||
async def test_load_unload_config_entry(
|
||||
@@ -56,10 +50,9 @@ async def test_load_unload_config_entry(
|
||||
await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert mock_config_entry.entry_id in hass.data[DOMAIN]
|
||||
assert mock_config_entry.state is ConfigEntryState.LOADED
|
||||
|
||||
await hass.config_entries.async_unload(mock_config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
assert mock_config_entry.entry_id not in hass.data[DOMAIN]
|
||||
|
||||
assert mock_config_entry.state is ConfigEntryState.NOT_LOADED
|
||||
|
||||
Reference in New Issue
Block a user