mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Avoid Home connect test doing I/O (#37017)
This commit is contained in:
parent
7c5e852303
commit
e6d814da1d
@ -8,6 +8,8 @@ from homeassistant.components.home_connect.const import (
|
|||||||
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
|
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
|
||||||
from homeassistant.helpers import config_entry_oauth2_flow
|
from homeassistant.helpers import config_entry_oauth2_flow
|
||||||
|
|
||||||
|
from tests.async_mock import patch
|
||||||
|
|
||||||
CLIENT_ID = "1234"
|
CLIENT_ID = "1234"
|
||||||
CLIENT_SECRET = "5678"
|
CLIENT_SECRET = "5678"
|
||||||
|
|
||||||
@ -53,6 +55,11 @@ async def test_full_flow(hass, aiohttp_client, aioclient_mock):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
with patch(
|
||||||
|
"homeassistant.components.home_connect.async_setup_entry", return_value=True
|
||||||
|
) as mock_setup_entry:
|
||||||
result = await hass.config_entries.flow.async_configure(result["flow_id"])
|
result = await hass.config_entries.flow.async_configure(result["flow_id"])
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
assert len(hass.config_entries.async_entries(DOMAIN)) == 1
|
assert len(hass.config_entries.async_entries(DOMAIN)) == 1
|
||||||
|
assert len(mock_setup_entry.mock_calls) == 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user