1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

On removal, only unload config entry if loaded (#16844)

* On removal, only unload config entry if loaded

* Fix test
This commit is contained in:
Paulus Schoutsen
2018-09-25 14:29:13 +02:00
committed by GitHub
parent 093285f92f
commit a1c914dfeb
3 changed files with 42 additions and 4 deletions

View File

@@ -72,7 +72,7 @@ def test_get_entries(hass, client):
@asyncio.coroutine
def test_remove_entry(hass, client):
"""Test removing an entry via the API."""
entry = MockConfigEntry(domain='demo')
entry = MockConfigEntry(domain='demo', state=core_ce.ENTRY_STATE_LOADED)
entry.add_to_hass(hass)
resp = yield from client.delete(
'/api/config/config_entries/entry/{}'.format(entry.entry_id))