Invert blocklist scheduler dependency to task callback
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user