Allow async_setup changes to config entry data be taken into a… (#34166)

* Allow async_setup changes to config entry data be taken into account

* Fix tests

* Limit scope try…finally

* Update tests/test_config_entries.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Fix import

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Paulus SchoutsenandMartin Hjelmare authored and GitHub committed 2020-04-14 18:46:41 -07:00
1 parent 0db1fcca0f
commit 0b90ebf91e
10 files changed
+176 -33

No files matched your search

-13
View File
@@ -9,19 +9,6 @@ from .test_device import MAC, setup_axis_integration
from tests.common import MockConfigEntry, mock_coro
async def test_setup_device_already_configured(hass):
"""Test already configured device does not configure a second."""
with patch.object(hass, "config_entries") as mock_config_entries:
assert await async_setup_component(
hass,
axis.DOMAIN,
{axis.DOMAIN: {"device_name": {axis.CONF_HOST: "1.2.3.4"}}},
)
assert not mock_config_entries.flow.mock_calls
async def test_setup_no_config(hass):
"""Test setup without configuration."""
assert await async_setup_component(hass, axis.DOMAIN, {})