Rework FlowManager to use inheritance (#30133)

* Pull async_finish_flow/async_create_flow out of ConfigEntries

* Towards refactoring

* mypy fixes

* Mark Flow manager with abc.* annotations

* Flake8 fixes

* Mypy fixes

* Blacken data_entry_flow

* Blacken longer signatures caused by mypy changes

* test fixes

* Test fixes

* Fix typo

* Avoid protected member lint (W0212) in config_entries

* More protected member fixes

* Missing await
This commit is contained in:
Jc2k authored and Paulus Schoutsen committed 2020-01-03 11:52:01 +01:00
1 parent 0a4f3ec1ec
commit fdfedd086b
12 files changed
+313 -258

No files matched your search

+4 -4
View File
@@ -131,12 +131,12 @@ async def test_option_flow(hass):
entry = MockConfigEntry(domain=DOMAIN, data={}, options=None)
entry.add_to_hass(hass)
result = await hass.config_entries.options.flow.async_init(entry.entry_id)
result = await hass.config_entries.options.async_init(entry.entry_id)
assert result["type"] == "form"
assert result["step_id"] == "init"
result = await hass.config_entries.options.flow.async_configure(
result = await hass.config_entries.options.async_configure(
result["flow_id"], user_input={CONF_SCAN_INTERVAL: 350}
)
assert result["type"] == "create_entry"
@@ -148,12 +148,12 @@ async def test_option_flow_input_floor(hass):
entry = MockConfigEntry(domain=DOMAIN, data={}, options=None)
entry.add_to_hass(hass)
result = await hass.config_entries.options.flow.async_init(entry.entry_id)
result = await hass.config_entries.options.async_init(entry.entry_id)
assert result["type"] == "form"
assert result["step_id"] == "init"
result = await hass.config_entries.options.flow.async_configure(
result = await hass.config_entries.options.async_configure(
result["flow_id"], user_input={CONF_SCAN_INTERVAL: 1}
)
assert result["type"] == "create_entry"