Remove dead task DB fast-path and update task tests

This commit is contained in:
2026-04-07 20:00:13 +02:00
parent 0a70e40d8b
commit e21f153946
9 changed files with 96 additions and 25 deletions

View File

@@ -36,8 +36,10 @@ class TestHistorySyncTask:
fake_app.state = type("FakeState", (), {})()
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.db = MagicMock()
fake_app.state.db.close = AsyncMock()
async def fake_get_history_page(*, db_path: str, since: int, page: int, page_size: int, **kwargs):
assert since == 1001
@@ -47,6 +49,10 @@ class TestHistorySyncTask:
return "/tmp/fake.sqlite3"
with patch(
"app.tasks.history_sync.open_db",
new_callable=AsyncMock,
return_value=fake_app.state.db,
), patch(
"app.tasks.history_sync._get_last_archive_ts",
new=AsyncMock(return_value=1000),
), patch(