Switch linear search to a dict lookup for ip bans (#74482)

This commit is contained in:
J. Nick Koston
2022-07-07 03:57:44 -05:00
committed by GitHub
parent ae295f1bf5
commit 0c29b68cf8
3 changed files with 170 additions and 58 deletions

View File

@@ -19,8 +19,7 @@ def patch_zeroconf_multiple_catcher():
def prevent_io():
"""Fixture to prevent certain I/O from happening."""
with patch(
"homeassistant.components.http.ban.async_load_ip_bans_config",
return_value=[],
"homeassistant.components.http.ban.load_yaml_config_file",
):
yield