a41eddae3f
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
"""Confirms every FC-2a task module imports cleanly and registers with Celery.
|
|
|
|
Celery's `include=[...]` parameter on the Celery() constructor is lazy — it
|
|
only imports those modules when a worker boots. To assert task registration
|
|
in a plain pytest run we explicitly import the task modules ourselves.
|
|
"""
|
|
|
|
# Importing for side-effect: each module's @celery.task decorators register
|
|
# the task with the global Celery instance at module import time.
|
|
import backend.app.tasks.import_file # noqa: F401
|
|
import backend.app.tasks.scan # noqa: F401
|
|
import backend.app.tasks.thumbnail # noqa: F401
|
|
from backend.app.celery_app import celery
|
|
|
|
|
|
def test_scan_task_registered():
|
|
assert "backend.app.tasks.scan.scan_directory" in celery.tasks
|
|
|
|
|
|
def test_import_media_file_registered():
|
|
assert "backend.app.tasks.import_file.import_media_file" in celery.tasks
|
|
|
|
|
|
def test_generate_thumbnail_registered():
|
|
assert "backend.app.tasks.thumbnail.generate_thumbnail" in celery.tasks
|
|
|
|
|
|
def test_backfill_thumbnails_registered():
|
|
assert "backend.app.tasks.thumbnail.backfill_thumbnails" in celery.tasks
|