feat(thumb-backfill): /api/thumbnails/backfill endpoint — POST → 202 + celery_task_id

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-26 10:36:38 -04:00
parent a41eddae3f
commit 983da9e5b1
3 changed files with 47 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
import pytest
from backend.app import create_app
from backend.app.celery_app import celery
pytestmark = pytest.mark.integration
@pytest.fixture(autouse=True)
def eager():
celery.conf.task_always_eager = True
yield
celery.conf.task_always_eager = False
@pytest.fixture
async def app():
return create_app()
@pytest.fixture
async def client(app):
async with app.test_client() as c:
yield c
@pytest.mark.asyncio
async def test_trigger_thumbnail_backfill(client):
r = await client.post("/api/thumbnails/backfill")
assert r.status_code == 202
body = await r.get_json()
assert "celery_task_id" in body