hass-core/tests/components/fritzbox/conftest.py
Paulus Schoutsen 2af984917e
Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00

14 lines
489 B
Python

"""Fixtures for the AVM Fritz!Box integration."""
import pytest
from tests.async_mock import Mock, patch
@pytest.fixture(name="fritz")
def fritz_fixture() -> Mock:
"""Patch libraries."""
with patch("homeassistant.components.fritzbox.socket") as socket, patch(
"homeassistant.components.fritzbox.Fritzhome"
) as fritz, patch("homeassistant.components.fritzbox.config_flow.Fritzhome"):
socket.gethostbyname.return_value = "FAKE_IP_ADDRESS"
yield fritz