Fix backend tests by using per-test temp config dir, align router mocks to service modules, fix log tail helper reference, and add JailNotFoundError.name

This commit is contained in:
2026-03-21 19:43:59 +01:00
parent 1f4ee360f6
commit 2022bcde99
5 changed files with 118 additions and 108 deletions

View File

@@ -6,6 +6,10 @@ from __future__ import annotations
class JailNotFoundError(Exception):
"""Raised when a requested jail name does not exist."""
def __init__(self, name: str) -> None:
self.name = name
super().__init__(f"Jail not found: {name!r}")
class JailOperationError(Exception):
"""Raised when a fail2ban jail operation fails."""

View File

@@ -719,7 +719,7 @@ async def read_fail2ban_log(
total_lines, raw_lines = await asyncio.gather(
loop.run_in_executor(None, _count_file_lines, resolved_str),
loop.run_in_executor(None, _read_tail_lines, resolved_str, lines),
loop.run_in_executor(None, log_service._read_tail_lines, resolved_str, lines),
)
filtered = (