Allow platform unloading (#13784)

* Allow platform unloading

* Add tests

* Add last test
This commit is contained in:
Paulus Schoutsen 2018-04-12 08:28:54 -04:00 committed by Pascal Vizeli
parent dd7e6edf61
commit f47572d3c0
12 changed files with 218 additions and 14 deletions

View file

@ -405,7 +405,7 @@ async def test_forward_entry_sets_up_component(hass):
'forwarded',
MockModule('forwarded', async_setup_entry=mock_forwarded_setup_entry))
await hass.config_entries.async_forward_entry(entry, 'forwarded')
await hass.config_entries.async_forward_entry_setup(entry, 'forwarded')
assert len(mock_original_setup_entry.mock_calls) == 0
assert len(mock_forwarded_setup_entry.mock_calls) == 1
@ -422,6 +422,6 @@ async def test_forward_entry_does_not_setup_entry_if_setup_fails(hass):
async_setup_entry=mock_setup_entry,
))
await hass.config_entries.async_forward_entry(entry, 'forwarded')
await hass.config_entries.async_forward_entry_setup(entry, 'forwarded')
assert len(mock_setup.mock_calls) == 1
assert len(mock_setup_entry.mock_calls) == 0