1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Prepare Plugwise integration for USB products (#41201)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Tom
2020-10-07 22:25:42 +02:00
committed by GitHub
parent 343e5d64b8
commit b8f291d58e
10 changed files with 299 additions and 212 deletions

View File

@@ -4,11 +4,14 @@ import asyncio
from Plugwise_Smile.Smile import Smile
from homeassistant.components.plugwise import DOMAIN
from homeassistant.components.plugwise.gateway import async_unload_entry
from homeassistant.config_entries import (
ENTRY_STATE_SETUP_ERROR,
ENTRY_STATE_SETUP_RETRY,
)
from tests.common import AsyncMock
from tests.components.plugwise.common import async_init_integration
@@ -43,3 +46,12 @@ async def test_smile_adam_xmlerror(hass, mock_smile_adam):
mock_smile_adam.full_update_device.side_effect = Smile.XMLDataMissingError
entry = await async_init_integration(hass, mock_smile_adam)
assert entry.state == ENTRY_STATE_SETUP_RETRY
async def test_unload_entry(hass, mock_smile_adam):
"""Test being able to unload an entry."""
entry = await async_init_integration(hass, mock_smile_adam)
mock_smile_adam.async_reset = AsyncMock(return_value=True)
assert await async_unload_entry(hass, entry)
assert not hass.data[DOMAIN]