From e6d814da1da1f0e91addbcd0d8fed7d39c8a0f57 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 22 Jun 2020 23:41:44 -0700 Subject: [PATCH] Avoid Home connect test doing I/O (#37017) --- tests/components/home_connect/test_config_flow.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/components/home_connect/test_config_flow.py b/tests/components/home_connect/test_config_flow.py index d6d936fe16e..57c6fb2af7f 100644 --- a/tests/components/home_connect/test_config_flow.py +++ b/tests/components/home_connect/test_config_flow.py @@ -8,6 +8,8 @@ from homeassistant.components.home_connect.const import ( from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET from homeassistant.helpers import config_entry_oauth2_flow +from tests.async_mock import patch + CLIENT_ID = "1234" CLIENT_SECRET = "5678" @@ -53,6 +55,11 @@ async def test_full_flow(hass, aiohttp_client, aioclient_mock): }, ) - result = await hass.config_entries.flow.async_configure(result["flow_id"]) + 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"]) + await hass.async_block_till_done() assert len(hass.config_entries.async_entries(DOMAIN)) == 1 + assert len(mock_setup_entry.mock_calls) == 1