Move Fail2Ban exceptions into central app.exceptions module
This commit is contained in:
@@ -106,7 +106,7 @@ class TestGetServerSettings:
|
||||
|
||||
async def test_502_on_connection_error(self, server_client: AsyncClient) -> None:
|
||||
"""GET /api/server/settings returns 502 when fail2ban is unreachable."""
|
||||
from app.utils.fail2ban_client import Fail2BanConnectionError
|
||||
from app.exceptions import Fail2BanConnectionError
|
||||
|
||||
with patch(
|
||||
"app.routers.server.server_service.get_settings",
|
||||
@@ -163,7 +163,7 @@ class TestUpdateServerSettings:
|
||||
|
||||
async def test_502_on_connection_error(self, server_client: AsyncClient) -> None:
|
||||
"""PUT /api/server/settings returns 502 when fail2ban is unreachable."""
|
||||
from app.utils.fail2ban_client import Fail2BanConnectionError
|
||||
from app.exceptions import Fail2BanConnectionError
|
||||
|
||||
with patch(
|
||||
"app.routers.server.server_service.update_settings",
|
||||
@@ -218,7 +218,7 @@ class TestFlushLogs:
|
||||
|
||||
async def test_502_on_connection_error(self, server_client: AsyncClient) -> None:
|
||||
"""POST /api/server/flush-logs returns 502 when fail2ban is unreachable."""
|
||||
from app.utils.fail2ban_client import Fail2BanConnectionError
|
||||
from app.exceptions import Fail2BanConnectionError
|
||||
|
||||
with patch(
|
||||
"app.routers.server.server_service.flush_logs",
|
||||
|
||||
Reference in New Issue
Block a user