Use built-in test helpers on 3.8 (#34901)

This commit is contained in:
Paulus Schoutsen 2020-04-30 13:29:50 -07:00 committed by GitHub
parent 6b16c34fd0
commit ec47216388
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
303 changed files with 1163 additions and 1320 deletions

View file

@ -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"]