Cast/Sonos: create config entry if manually configured (#15630)
* Cast/Sonos: create config entry if manually configured * Add test for helper
This commit is contained in:
parent
f3dfc433c2
commit
3204501174
6 changed files with 109 additions and 2 deletions
|
@ -114,3 +114,24 @@ async def test_user_init_trumps_discovery(hass, flow_conf):
|
|||
|
||||
# Discovery flow has been aborted
|
||||
assert len(hass.config_entries.flow.async_progress()) == 0
|
||||
|
||||
|
||||
async def test_import_no_confirmation(hass, flow_conf):
|
||||
"""Test import requires no confirmation to setup."""
|
||||
flow = config_entries.HANDLERS['test']()
|
||||
flow.hass = hass
|
||||
flow_conf['discovered'] = True
|
||||
|
||||
result = await flow.async_step_import(None)
|
||||
assert result['type'] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
|
||||
|
||||
async def test_import_single_instance(hass, flow_conf):
|
||||
"""Test import doesn't create second instance."""
|
||||
flow = config_entries.HANDLERS['test']()
|
||||
flow.hass = hass
|
||||
flow_conf['discovered'] = True
|
||||
MockConfigEntry(domain='test').add_to_hass(hass)
|
||||
|
||||
result = await flow.async_step_import(None)
|
||||
assert result['type'] == data_entry_flow.RESULT_TYPE_ABORT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue