Document task DB access and unify background task DB handling

This commit is contained in:
2026-04-17 17:18:49 +02:00
parent 16687b0520
commit 5e5d7c34b2
12 changed files with 139 additions and 90 deletions

View File

@@ -37,12 +37,13 @@ class TestHistorySyncTask:
fake_app.state.settings = type("FakeSettings", (), {})()
fake_app.state.settings.fail2ban_socket = "/tmp/fake.sock"
fake_app.state.settings.database_path = "/tmp/fake.db"
fake_app.state.runtime_settings = None
fake_db = AsyncMock()
fake_db.close = AsyncMock()
with patch(
"app.tasks.history_sync.open_db",
"app.tasks.db.open_db",
new_callable=AsyncMock,
return_value=fake_db,
), patch(