Remove config entry specifics from FlowManager (#85565)
This commit is contained in:
parent
0f3221eac7
commit
3cd6bd87a7
5 changed files with 119 additions and 85 deletions
|
@ -1,5 +1,4 @@
|
|||
"""Test the flow classes."""
|
||||
import asyncio
|
||||
import logging
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
|
@ -181,7 +180,7 @@ async def test_abort_calls_async_remove_with_exception(manager, caplog):
|
|||
with caplog.at_level(logging.ERROR):
|
||||
await manager.async_init("test")
|
||||
|
||||
assert "Error removing test config flow: error" in caplog.text
|
||||
assert "Error removing test flow: error" in caplog.text
|
||||
|
||||
TestFlow.async_remove.assert_called_once()
|
||||
|
||||
|
@ -419,22 +418,6 @@ async def test_abort_flow_exception(manager):
|
|||
assert form["description_placeholders"] == {"placeholder": "yo"}
|
||||
|
||||
|
||||
async def test_initializing_flows_canceled_on_shutdown(hass, manager):
|
||||
"""Test that initializing flows are canceled on shutdown."""
|
||||
|
||||
@manager.mock_reg_handler("test")
|
||||
class TestFlow(data_entry_flow.FlowHandler):
|
||||
async def async_step_init(self, user_input=None):
|
||||
await asyncio.sleep(1)
|
||||
|
||||
task = asyncio.create_task(manager.async_init("test"))
|
||||
await hass.async_block_till_done()
|
||||
await manager.async_shutdown()
|
||||
|
||||
with pytest.raises(asyncio.exceptions.CancelledError):
|
||||
await task
|
||||
|
||||
|
||||
async def test_init_unknown_flow(manager):
|
||||
"""Test that UnknownFlow is raised when async_create_flow returns None."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue