Invert blocklist scheduler dependency to task callback

This commit is contained in:
2026-04-15 21:31:08 +02:00
parent a5e95e2061
commit 73cc212e28
6 changed files with 25 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ registers the correct APScheduler trigger for each frequency preset.
from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, MagicMock, call, patch
from unittest.mock import ANY, AsyncMock, MagicMock, call, patch
import pytest
@@ -42,6 +42,7 @@ def _make_app(
fail2ban_socket="/var/run/fail2ban/fail2ban.sock",
database_path="/tmp/fake.db",
)
app.state.runtime_settings = None
return app
@@ -111,6 +112,7 @@ class TestRunImport:
app.state.db,
app.state.http_session,
app.state.settings.fail2ban_socket,
ban_ip=ANY,
)
@pytest.mark.asyncio
@@ -196,6 +198,7 @@ class TestApplySchedule:
"""
app = MagicMock()
app.state.scheduler = scheduler
app.state.runtime_settings = None
return app
def test_apply_schedule_daily_registers_cron_trigger(self) -> None: