Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing mock in abode config flow tests #88828

Merged
merged 3 commits into from Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/components/abode/conftest.py
@@ -1,11 +1,23 @@
"""Configuration for Abode tests."""
from collections.abc import Generator
from unittest.mock import AsyncMock, patch

from jaraco.abode.helpers import urls as URL
import pytest

from tests.common import load_fixture
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)
def requests_mock_fixture(requests_mock) -> None:
"""Fixture to provide a requests mocker."""
Expand Down
3 changes: 3 additions & 0 deletions tests/components/abode/test_config_flow.py
Expand Up @@ -6,6 +6,7 @@
AuthenticationException as AbodeAuthenticationException,
)
from jaraco.abode.helpers.errors import MFA_CODE_REQUIRED
import pytest
from requests.exceptions import ConnectTimeout

from homeassistant import data_entry_flow
Expand All @@ -17,6 +18,8 @@

from tests.common import MockConfigEntry

pytestmark = pytest.mark.usefixtures("mock_setup_entry")


async def test_show_form(hass: HomeAssistant) -> None:
"""Test that the form is served with no input."""
Expand Down