core/tests/components/fritzbox/conftest.py

15 lines
440 B
Python
Raw Normal View History

"""Fixtures for the AVM Fritz!Box integration."""
2021-01-01 21:31:56 +00:00
from unittest.mock import Mock, patch
2021-01-01 21:31:56 +00:00
import pytest
@pytest.fixture(name="fritz")
def fritz_fixture() -> Mock:
"""Patch libraries."""
with patch("homeassistant.components.fritzbox.Fritzhome") as fritz, patch(
"homeassistant.components.fritzbox.config_flow.Fritzhome"
):
fritz.return_value.get_prefixed_host.return_value = "http://1.2.3.4"
yield fritz