mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix slow config_flow test in bond (#60355)
This commit is contained in:
parent
03d1efab46
commit
fb909eca8a
@ -194,6 +194,7 @@ async def test_user_form_one_entry_per_device_allowed(hass: core.HomeAssistant):
|
||||
async def test_zeroconf_form(hass: core.HomeAssistant):
|
||||
"""Test we get the discovery form."""
|
||||
|
||||
with patch_bond_version(), patch_bond_token():
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
@ -326,13 +327,12 @@ async def test_zeroconf_already_configured(hass: core.HomeAssistant):
|
||||
type="mock_type",
|
||||
),
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result["type"] == "abort"
|
||||
assert result["reason"] == "already_configured"
|
||||
assert entry.data["host"] == "updated-host"
|
||||
|
||||
await hass.async_block_till_done()
|
||||
assert len(mock_setup_entry.mock_calls) == 0
|
||||
assert len(mock_setup_entry.mock_calls) == 1
|
||||
|
||||
|
||||
async def test_zeroconf_already_configured_refresh_token(hass: core.HomeAssistant):
|
||||
@ -442,6 +442,7 @@ async def _help_test_form_unexpected_error(
|
||||
error: Exception,
|
||||
):
|
||||
"""Test we handle unexpected error gracefully."""
|
||||
with patch_bond_token():
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": source}, data=initial_input
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user