mirror of
https://github.com/home-assistant/core
synced 2024-09-15 17:29:45 +02:00
Add missing mock in fibaro config flow tests (#89440)
This commit is contained in:
parent
01d8eaa5b6
commit
4e4608183e
14
tests/components/fibaro/conftest.py
Normal file
14
tests/components/fibaro/conftest.py
Normal file
@ -0,0 +1,14 @@
|
||||
"""Test helpers."""
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
||||
"""Override async_setup_entry."""
|
||||
with patch(
|
||||
"homeassistant.components.fibaro.async_setup_entry", return_value=True
|
||||
) as mock_setup_entry:
|
||||
yield mock_setup_entry
|
@ -20,6 +20,8 @@ TEST_USERNAME = "user"
|
||||
TEST_PASSWORD = "password"
|
||||
TEST_VERSION = "4.360"
|
||||
|
||||
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
|
||||
|
||||
|
||||
@pytest.fixture(name="fibaro_client", autouse=True)
|
||||
def fibaro_client_fixture():
|
||||
@ -69,9 +71,6 @@ async def test_config_flow_user_initiated_success(hass: HomeAssistant) -> None:
|
||||
with patch(
|
||||
"homeassistant.components.fibaro.FibaroClient.connect",
|
||||
return_value=True,
|
||||
), patch(
|
||||
"homeassistant.components.fibaro.async_setup_entry",
|
||||
return_value=True,
|
||||
):
|
||||
result = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"],
|
||||
@ -239,9 +238,6 @@ async def test_reauth_success(hass: HomeAssistant) -> None:
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.fibaro.FibaroClient.connect", return_value=True
|
||||
), patch(
|
||||
"homeassistant.components.fibaro.async_setup_entry",
|
||||
return_value=True,
|
||||
):
|
||||
result = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"],
|
||||
|
Loading…
Reference in New Issue
Block a user