mirror of
https://github.com/home-assistant/core.git
synced 2026-04-25 16:25:33 +00:00
Mock async_setup_entry in speedtestdotnet config flow test (#164387)
This commit is contained in:
@@ -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."""
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user