From ba7b5681e6a8f74f8d929163a066c216ef6bd1e3 Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Thu, 25 Nov 2021 22:34:47 +0100 Subject: [PATCH] Fix slow config_flow test in Dune HD (#60366) --- tests/components/dunehd/test_config_flow.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/components/dunehd/test_config_flow.py b/tests/components/dunehd/test_config_flow.py index c8e7b0f7f3e..73732236077 100644 --- a/tests/components/dunehd/test_config_flow.py +++ b/tests/components/dunehd/test_config_flow.py @@ -16,7 +16,9 @@ DUNEHD_STATE = {"protocol_version": "4", "player_state": "navigator"} async def test_import(hass): """Test that the import works.""" - with patch("pdunehd.DuneHDPlayer.update_state", return_value=DUNEHD_STATE): + with patch("homeassistant.components.dunehd.async_setup_entry"), patch( + "pdunehd.DuneHDPlayer.update_state", return_value=DUNEHD_STATE + ): result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_IMPORT}, data=CONFIG_HOSTNAME ) @@ -108,7 +110,9 @@ async def test_duplicate_error(hass): async def test_create_entry(hass): """Test that the user step works.""" - with patch("pdunehd.DuneHDPlayer.update_state", return_value=DUNEHD_STATE): + with patch("homeassistant.components.dunehd.async_setup_entry"), patch( + "pdunehd.DuneHDPlayer.update_state", return_value=DUNEHD_STATE + ): result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER}, data=CONFIG_HOSTNAME ) @@ -120,7 +124,9 @@ async def test_create_entry(hass): async def test_create_entry_with_ipv6_address(hass): """Test that the user step works with device IPv6 address..""" - with patch("pdunehd.DuneHDPlayer.update_state", return_value=DUNEHD_STATE): + with patch("homeassistant.components.dunehd.async_setup_entry"), patch( + "pdunehd.DuneHDPlayer.update_state", return_value=DUNEHD_STATE + ): result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER},