Further untangle data entry flow (#13855)
* Further untangle data entry flow * Fix test * Remove helper class
This commit is contained in:
1 parent
5a5dad689b
commit
4d44c0feff
5 files changed
+47
-47
No files matched your search
@@ -120,7 +120,7 @@ def test_initialize_flow(hass, client):
|
||||
|
||||
assert data == {
|
||||
'type': 'form',
|
||||
'domain': 'test',
|
||||
'handler': 'test',
|
||||
'step_id': 'init',
|
||||
'data_schema': [
|
||||
{
|
||||
@@ -156,7 +156,7 @@ def test_abort(hass, client):
|
||||
data = yield from resp.json()
|
||||
data.pop('flow_id')
|
||||
assert data == {
|
||||
'domain': 'test',
|
||||
'handler': 'test',
|
||||
'reason': 'bla',
|
||||
'type': 'abort'
|
||||
}
|
||||
@@ -186,7 +186,7 @@ def test_create_account(hass, client):
|
||||
data = yield from resp.json()
|
||||
data.pop('flow_id')
|
||||
assert data == {
|
||||
'domain': 'test',
|
||||
'handler': 'test',
|
||||
'title': 'Test Entry',
|
||||
'type': 'create_entry',
|
||||
'source': 'user',
|
||||
@@ -226,7 +226,7 @@ def test_two_step_flow(hass, client):
|
||||
flow_id = data.pop('flow_id')
|
||||
assert data == {
|
||||
'type': 'form',
|
||||
'domain': 'test',
|
||||
'handler': 'test',
|
||||
'step_id': 'account',
|
||||
'data_schema': [
|
||||
{
|
||||
@@ -245,7 +245,7 @@ def test_two_step_flow(hass, client):
|
||||
data = yield from resp.json()
|
||||
data.pop('flow_id')
|
||||
assert data == {
|
||||
'domain': 'test',
|
||||
'handler': 'test',
|
||||
'type': 'create_entry',
|
||||
'title': 'user-title',
|
||||
'version': 1,
|
||||
@@ -279,7 +279,7 @@ def test_get_progress_index(hass, client):
|
||||
assert data == [
|
||||
{
|
||||
'flow_id': form['flow_id'],
|
||||
'domain': 'test',
|
||||
'handler': 'test',
|
||||
'source': 'hassio'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -169,7 +169,7 @@ async def test_discover_config_flow(hass):
|
||||
|
||||
with patch.dict(discovery.CONFIG_ENTRY_HANDLERS, {
|
||||
'mock-service': 'mock-component'}), patch(
|
||||
'homeassistant.config_entries.FlowManager.async_init') as m_init:
|
||||
'homeassistant.data_entry_flow.FlowManager.async_init') as m_init:
|
||||
await mock_discovery(hass, discover)
|
||||
|
||||
assert len(m_init.mock_calls) == 1
|
||||
|
||||
Reference in new issue
Block a user