mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add missing mock in airvisual_pro config flow tests (#89362)
This commit is contained in:
parent
23698eb99f
commit
3a40f5f35b
@ -1,4 +1,5 @@
|
|||||||
"""Define test fixtures for AirVisual Pro."""
|
"""Define test fixtures for AirVisual Pro."""
|
||||||
|
from collections.abc import Generator
|
||||||
import json
|
import json
|
||||||
from unittest.mock import AsyncMock, Mock, patch
|
from unittest.mock import AsyncMock, Mock, patch
|
||||||
|
|
||||||
@ -11,6 +12,15 @@ from homeassistant.setup import async_setup_component
|
|||||||
from tests.common import MockConfigEntry, load_fixture
|
from tests.common import MockConfigEntry, load_fixture
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
||||||
|
"""Override async_setup_entry."""
|
||||||
|
with patch(
|
||||||
|
"homeassistant.components.airvisual_pro.async_setup_entry", return_value=True
|
||||||
|
) as mock_setup_entry:
|
||||||
|
yield mock_setup_entry
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="config_entry")
|
@pytest.fixture(name="config_entry")
|
||||||
def config_entry_fixture(hass, config):
|
def config_entry_fixture(hass, config):
|
||||||
"""Define a config entry fixture."""
|
"""Define a config entry fixture."""
|
||||||
|
@ -14,6 +14,8 @@ from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_REAUTH, SOURCE_US
|
|||||||
from homeassistant.const import CONF_IP_ADDRESS, CONF_PASSWORD
|
from homeassistant.const import CONF_IP_ADDRESS, CONF_PASSWORD
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
("connect_mock", "connect_errors"),
|
("connect_mock", "connect_errors"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user