dify/api/tests/test_containers_integration.../tasks
Yongtao Huang 5bc6e8a433
Fix: correct regex for file-preview URL re-signing (#25620)
Fixes #25619

The regex patterns for file-preview and image-preview contained an unescaped `?`, 
which caused incorrect matches such as `file-previe` or `image-previw`. 
This led to malformed URLs being incorrectly re-signed.

Changes:
- Escape `?` in both file-preview and image-preview regex patterns.
- Ensure only valid URLs are re-signed.

Added unit tests to cover:
- Valid file-preview and image-preview URLs (correctly re-signed).
- Misspelled file/image preview URLs (no longer incorrectly matched).

Other:
- Fix a deprecated function `datetime.utcnow()`

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
2025-09-22 10:58:29 +08:00
..
__init__.py Feature add test containers add document to index (#25251) 2025-09-05 19:20:37 +08:00
test_add_document_to_index_task.py Feature add test containers add document to index (#25251) 2025-09-05 19:20:37 +08:00
test_batch_clean_document_task.py Fix: correct regex for file-preview URL re-signing (#25620) 2025-09-22 10:58:29 +08:00
test_batch_create_segment_to_index_task.py ruff check preview (#25653) 2025-09-16 12:58:12 +08:00
test_clean_dataset_task.py ruff check preview (#25653) 2025-09-16 12:58:12 +08:00
test_clean_notion_document_task.py feat: add test containers based tests for clean notion document task (#25385) 2025-09-09 11:02:19 +08:00
test_create_segment_to_index_task.py Feature add test containers create segment to index task (#25450) 2025-09-10 10:02:53 +08:00
test_deal_dataset_vector_index_task.py feat: add test containers based tests for deal dataset vector index (#25545) 2025-09-11 21:12:53 +08:00
test_delete_segment_from_index_task.py feat: add test containers based tests for delete segment from index task (#25564) 2025-09-12 09:33:39 +08:00
test_disable_segment_from_index_task.py Feature add test containers disable segment from index task (#25631) 2025-09-13 14:28:10 +08:00
test_disable_segments_from_index_task.py fix(tests): resolve order dependency in disable_segments_from_index_task tests (#25737) 2025-09-16 08:26:52 +08:00
test_document_indexing_task.py Feature: add test containers document indexing task (#25684) 2025-09-16 09:47:28 +08:00