mirror of
https://github.com/home-assistant/core.git
synced 2026-06-30 19:26:31 +01:00
Use hass.config_entries.async_setup in vesync tests (#173868)
This commit is contained in:
committed by
GitHub
parent
3b46bf45e7
commit
d71eb19a64
@@ -10,10 +10,7 @@ from pyvesync.utils.errors import (
|
||||
VeSyncServerError,
|
||||
)
|
||||
|
||||
from homeassistant.components.vesync import (
|
||||
async_remove_config_entry_device,
|
||||
async_setup_entry,
|
||||
)
|
||||
from homeassistant.components.vesync import async_remove_config_entry_device
|
||||
from homeassistant.components.vesync.const import DOMAIN
|
||||
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
|
||||
from homeassistant.const import Platform
|
||||
@@ -54,8 +51,7 @@ async def test_async_setup_entry__no_devices(
|
||||
) -> None:
|
||||
"""Test setup connects to vesync and creates empty config when no devices."""
|
||||
with patch.object(hass.config_entries, "async_forward_entry_setups") as setups_mock:
|
||||
# pylint: disable-next=home-assistant-tests-direct-async-setup-entry
|
||||
assert await async_setup_entry(hass, config_entry)
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
# Assert platforms loaded
|
||||
await hass.async_block_till_done()
|
||||
assert setups_mock.call_count == 1
|
||||
@@ -82,8 +78,7 @@ async def test_async_setup_entry__loads_fans(
|
||||
manager._dev_list["fans"].append(fan)
|
||||
|
||||
with patch.object(hass.config_entries, "async_forward_entry_setups") as setups_mock:
|
||||
# pylint: disable-next=home-assistant-tests-direct-async-setup-entry
|
||||
assert await async_setup_entry(hass, config_entry)
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
# Assert platforms loaded
|
||||
await hass.async_block_till_done()
|
||||
assert setups_mock.call_count == 1
|
||||
|
||||
Reference in New Issue
Block a user