* Use asynctest patch instead of mock_coro * Add test for supervisor ip ban * Do not ban supervisor ip if set * Extract supervisor ip helper * Check supervisor ip before banning * Remove added blank line * Clean up get supervisor ip Co-Authored-By: Pascal Vizeli <pvizeli@syshack.ch> Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
12 lines
312 B
Python
12 lines
312 B
Python
"""Fixtures for component testing."""
|
|
from asynctest import patch
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def prevent_io():
|
|
"""Fixture to prevent certain I/O from happening."""
|
|
with patch(
|
|
"homeassistant.components.http.ban.async_load_ip_bans_config", return_value=[],
|
|
):
|
|
yield
|