Use a future for mock coro (#34989)
This commit is contained in:
1 parent
ba7391528f
commit
76f392476b
26 files changed
+154
-262
No files matched your search
@@ -1,18 +1,17 @@
|
||||
"""Tests for the cloud component."""
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant.components import cloud
|
||||
from homeassistant.components.cloud import const
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import mock_coro
|
||||
from tests.async_mock import AsyncMock, patch
|
||||
|
||||
|
||||
async def mock_cloud(hass, config=None):
|
||||
"""Mock cloud."""
|
||||
assert await async_setup_component(hass, cloud.DOMAIN, {"cloud": config or {}})
|
||||
cloud_inst = hass.data["cloud"]
|
||||
with patch("hass_nabucasa.Cloud.run_executor", return_value=mock_coro()):
|
||||
with patch("hass_nabucasa.Cloud.run_executor", AsyncMock(return_value=None)):
|
||||
await cloud_inst.start()
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user