mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Update config_entry_flow test test_user_has_confirmation (#36633)
* Update test_user_has_confirmation * Rewrite test according to review comment
This commit is contained in:
parent
1ffa8fcbba
commit
922b332766
@ -66,15 +66,19 @@ async def test_user_no_devices_found(hass, discovery_flow_conf):
|
|||||||
|
|
||||||
|
|
||||||
async def test_user_has_confirmation(hass, discovery_flow_conf):
|
async def test_user_has_confirmation(hass, discovery_flow_conf):
|
||||||
"""Test user requires no confirmation to setup."""
|
"""Test user requires confirmation to setup."""
|
||||||
flow = config_entries.HANDLERS["test"]()
|
|
||||||
flow.hass = hass
|
|
||||||
flow.context = {}
|
|
||||||
discovery_flow_conf["discovered"] = True
|
discovery_flow_conf["discovered"] = True
|
||||||
|
mock_entity_platform(hass, "config_flow.test", None)
|
||||||
|
|
||||||
result = await flow.async_step_user()
|
result = await hass.config_entries.flow.async_init(
|
||||||
|
"test", context={"source": config_entries.SOURCE_USER}, data={}
|
||||||
|
)
|
||||||
|
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||||
|
assert result["step_id"] == "confirm"
|
||||||
|
|
||||||
|
result = await hass.config_entries.flow.async_configure(result["flow_id"], {})
|
||||||
|
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("source", ["discovery", "ssdp", "zeroconf"])
|
@pytest.mark.parametrize("source", ["discovery", "ssdp", "zeroconf"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user