mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add missing mock in abode config flow tests (#88828)
This commit is contained in:
parent
5cc9e7fedd
commit
198ebaff6e
@ -1,4 +1,7 @@
|
|||||||
"""Configuration for Abode tests."""
|
"""Configuration for Abode tests."""
|
||||||
|
from collections.abc import Generator
|
||||||
|
from unittest.mock import AsyncMock, patch
|
||||||
|
|
||||||
from jaraco.abode.helpers import urls as URL
|
from jaraco.abode.helpers import urls as URL
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@ -6,6 +9,15 @@ from tests.common import load_fixture
|
|||||||
from tests.components.light.conftest import mock_light_profiles # noqa: F401
|
from tests.components.light.conftest import mock_light_profiles # noqa: F401
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
||||||
|
"""Override async_setup_entry."""
|
||||||
|
with patch(
|
||||||
|
"homeassistant.components.abode.async_setup_entry", return_value=True
|
||||||
|
) as mock_setup_entry:
|
||||||
|
yield mock_setup_entry
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def requests_mock_fixture(requests_mock) -> None:
|
def requests_mock_fixture(requests_mock) -> None:
|
||||||
"""Fixture to provide a requests mocker."""
|
"""Fixture to provide a requests mocker."""
|
||||||
|
@ -6,6 +6,7 @@ from jaraco.abode.exceptions import (
|
|||||||
AuthenticationException as AbodeAuthenticationException,
|
AuthenticationException as AbodeAuthenticationException,
|
||||||
)
|
)
|
||||||
from jaraco.abode.helpers.errors import MFA_CODE_REQUIRED
|
from jaraco.abode.helpers.errors import MFA_CODE_REQUIRED
|
||||||
|
import pytest
|
||||||
from requests.exceptions import ConnectTimeout
|
from requests.exceptions import ConnectTimeout
|
||||||
|
|
||||||
from homeassistant import data_entry_flow
|
from homeassistant import data_entry_flow
|
||||||
@ -17,6 +18,8 @@ from homeassistant.core import HomeAssistant
|
|||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
|
||||||
|
|
||||||
|
|
||||||
async def test_show_form(hass: HomeAssistant) -> None:
|
async def test_show_form(hass: HomeAssistant) -> None:
|
||||||
"""Test that the form is served with no input."""
|
"""Test that the form is served with no input."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user