Mock async_setup_entry in speedtestdotnet config flow test (#164387)

This commit is contained in:
Franck Nijhof
2026-02-27 20:30:47 +01:00
committed by GitHub
parent 97bcea9727
commit addc2a6766
2 changed files with 11 additions and 1 deletions

View File

@@ -7,6 +7,16 @@ import pytest
from . import MOCK_SERVERS
@pytest.fixture
def mock_setup_entry():
"""Mock setting up a config entry."""
with patch(
"homeassistant.components.speedtestdotnet.async_setup_entry",
return_value=True,
) as mock_setup:
yield mock_setup
@pytest.fixture
def mock_api():
"""Mock entry setup."""

View File

@@ -14,7 +14,7 @@ from homeassistant.data_entry_flow import FlowResultType
from tests.common import MockConfigEntry
async def test_flow_works(hass: HomeAssistant) -> None:
async def test_flow_works(hass: HomeAssistant, mock_setup_entry: MagicMock) -> None:
"""Test user config."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}