Use built-in test helpers on 3.8 (#34901)
This commit is contained in:
parent
6b16c34fd0
commit
ec47216388
303 changed files with 1163 additions and 1320 deletions
|
@ -1,9 +1,8 @@
|
|||
"""Common functions for tests."""
|
||||
from asynctest import CoroutineMock, Mock, call, patch
|
||||
|
||||
from homeassistant.components import dynalite
|
||||
from homeassistant.helpers import entity_registry
|
||||
|
||||
from tests.async_mock import AsyncMock, Mock, call, patch
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
ATTR_SERVICE = "service"
|
||||
|
@ -38,7 +37,7 @@ async def create_entity_from_device(hass, device):
|
|||
with patch(
|
||||
"homeassistant.components.dynalite.bridge.DynaliteDevices"
|
||||
) as mock_dyn_dev:
|
||||
mock_dyn_dev().async_setup = CoroutineMock(return_value=True)
|
||||
mock_dyn_dev().async_setup = AsyncMock(return_value=True)
|
||||
assert await hass.config_entries.async_setup(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
new_device_func = mock_dyn_dev.mock_calls[1][2]["new_device_func"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue