2018-10-11 10:37:34 +02:00
|
|
|
"""Common tradfri test fixtures."""
|
|
|
|
import pytest
|
|
|
|
|
2020-04-30 13:29:50 -07:00
|
|
|
from tests.async_mock import patch
|
|
|
|
|
2018-10-11 10:37:34 +02:00
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def mock_gateway_info():
|
|
|
|
"""Mock get_gateway_info."""
|
2019-07-31 12:25:30 -07:00
|
|
|
with patch(
|
2020-01-02 21:17:10 +02:00
|
|
|
"homeassistant.components.tradfri.config_flow.get_gateway_info"
|
2019-07-31 12:25:30 -07:00
|
|
|
) as mock_gateway:
|
2018-10-11 10:37:34 +02:00
|
|
|
yield mock_gateway
|
2020-01-03 16:28:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def mock_entry_setup():
|
|
|
|
"""Mock entry setup."""
|
|
|
|
with patch("homeassistant.components.tradfri.async_setup_entry") as mock_setup:
|
2020-04-25 14:32:55 -07:00
|
|
|
mock_setup.return_value = True
|
2020-01-03 16:28:05 +00:00
|
|
|
yield mock_setup
|