fix(tasks): register upload_to_user_integration in celery_worker and add handler tests
- Add `from app.tasks.upload_to_user_integration import upload_to_user_integration` to app/celery_worker.py — fixes TestCeleryWorkerConfig test that enforces every tasks/ module is registered with Celery. - Add tests/test_upload_handlers.py with 43 unit tests covering all 11 per-type upload handler functions (_upload_dropbox, _upload_s3, _upload_google_drive, _upload_onedrive, _upload_webdav, _upload_nextcloud, _upload_ftp, _upload_sftp, _upload_paperless, _upload_email, _upload_rclone) plus 2 additional finalize_document_storage branch tests. All external libraries (dropbox, boto3, msal, paramiko, smtplib, subprocess, requests) are mocked so tests are hermetic and fast. Coverage on changed files: upload_to_user_integration.py 94.71%, finalize_document_storage.py 95.51% (both well above the 70% Codecov diff threshold). Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -38,6 +38,7 @@ from app.tasks.upload_to_onedrive import upload_to_onedrive # noqa: F401
|
||||
from app.tasks.upload_to_paperless import upload_to_paperless # noqa: F401
|
||||
from app.tasks.upload_to_s3 import upload_to_s3 # noqa: F401
|
||||
from app.tasks.upload_to_sftp import upload_to_sftp # noqa: F401
|
||||
from app.tasks.upload_to_user_integration import upload_to_user_integration # noqa: F401
|
||||
from app.tasks.upload_to_webdav import upload_to_webdav # noqa: F401
|
||||
from app.tasks.upload_with_rclone import send_to_all_rclone_destinations, upload_with_rclone # noqa: F401
|
||||
from app.tasks.uptime_kuma_tasks import ping_uptime_kuma # noqa: F401
|
||||
|
||||
Reference in New Issue
Block a user