hass-core/tests/components/intellifire/conftest.py
Franck Nijhof 8b8f750c41
Address after merge review comments on IntelliFire (#64553)
* Remove unneeded coordinator update method parameter

* Remove unused error

* Remove unused translation strings

* Remove leftover debug print from tests

* Improve tests

* Cleanup unused entry ID

* Typing completions
2022-01-20 13:48:24 +01:00

29 lines
878 B
Python

"""Fixtures for IntelliFire integration tests."""
from collections.abc import Generator
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import pytest
@pytest.fixture
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Mock setting up a config entry."""
with patch(
"homeassistant.components.intellifire.async_setup_entry", return_value=True
) as mock_setup:
yield mock_setup
@pytest.fixture
def mock_intellifire_config_flow() -> Generator[None, MagicMock, None]:
"""Return a mocked IntelliFire client."""
data_mock = Mock()
data_mock.serial = "12345"
with patch(
"homeassistant.components.intellifire.config_flow.IntellifireAsync",
autospec=True,
) as intellifire_mock:
intellifire = intellifire_mock.return_value
intellifire.data = data_mock
yield intellifire