2018-05-01 17:35:23 +00:00
|
|
|
"""Fixtures for component testing."""
|
|
|
|
import pytest
|
|
|
|
|
2020-08-12 14:08:33 +00:00
|
|
|
from homeassistant.components import zeroconf
|
|
|
|
|
2020-04-30 20:29:50 +00:00
|
|
|
from tests.async_mock import patch
|
|
|
|
|
2020-08-12 14:08:33 +00:00
|
|
|
zeroconf.orig_install_multiple_zeroconf_catcher = (
|
|
|
|
zeroconf.install_multiple_zeroconf_catcher
|
|
|
|
)
|
|
|
|
zeroconf.install_multiple_zeroconf_catcher = lambda zc: None
|
|
|
|
|
2018-11-21 19:55:21 +00:00
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
|
|
def prevent_io():
|
|
|
|
"""Fixture to prevent certain I/O from happening."""
|
2019-07-31 19:25:30 +00:00
|
|
|
with patch(
|
2020-04-08 17:31:44 +00:00
|
|
|
"homeassistant.components.http.ban.async_load_ip_bans_config", return_value=[],
|
2019-07-31 19:25:30 +00:00
|
|
|
):
|
2018-11-21 19:55:21 +00:00
|
|
|
yield
|