Fix slow config_flow test in Dune HD (#60366)

pull/60372/head
Michael 2021-11-25 22:34:47 +01:00 committed by GitHub
parent de78c4f0f8
commit ba7b5681e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -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},