2018-05-01 17:35:23 +00:00
|
|
|
"""Fixtures for component testing."""
|
2018-09-11 16:08:03 +00:00
|
|
|
from unittest.mock import patch
|
|
|
|
|
2018-05-01 17:35:23 +00:00
|
|
|
import pytest
|
|
|
|
|
2018-12-02 15:32:53 +00:00
|
|
|
from tests.common import mock_coro
|
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(
|
|
|
|
"homeassistant.components.http.ban.async_load_ip_bans_config",
|
|
|
|
side_effect=lambda *args: mock_coro([]),
|
|
|
|
):
|
2018-11-21 19:55:21 +00:00
|
|
|
yield
|