Compare commits

...

1 Commits

Author SHA1 Message Date
CI Bot 4da3eae11a style: auto-format with black + isort + ruff + prettier [skip ci-format-check]
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 1s
CI/CD Pipeline / Check push changed paths (push) Successful in 2s
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / PR Build API Image (push) Has been skipped
CI/CD Pipeline / PR Build Web Image (push) Has been skipped
CI/CD Pipeline / PR Build Worker Image (push) Has been skipped
CI/CD Pipeline / Build Staging Web Image (push) Has been skipped
CI/CD Pipeline / Build Staging API Image (push) Failing after 1m3s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 2m6s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 2m28s
CI/CD Pipeline / Integration Tests (push) Successful in 5m10s
CI/CD Pipeline / Validate - Style (push) Successful in 5m51s
CI/CD Pipeline / Unit Tests (push) Successful in 11m37s
CI/CD Pipeline / Validate - Security (push) Successful in 15m14s
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / CI Gate (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (push) Failing after 25m15s
CI/CD Pipeline / Retag skipped Staging API Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Failing after 2m41s
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Canary Release to Production (push) Has been skipped
2026-09-16 16:50:47 +00:00
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -3,13 +3,13 @@
from __future__ import annotations
import pytest
from fastapi import HTTPException, status
# 直接 import 模块,用 _extract_url_from_text / _extract_and_validate_douyin_url 测试
from app.api.routes.scripts_ai import (
_extract_and_validate_douyin_url,
_extract_url_from_text,
)
from fastapi import HTTPException, status
class TestExtractUrlFromText:
@@ -337,7 +337,9 @@ def test_ydl_opts_includes_cookiefile_when_file_exists(fake_user):
):
scripts_ai.extract_from_douyin(request=body, current_user=fake_user, db=mock.MagicMock())
assert captured_opts_download.get("cookiefile") == "/tmp/fake_cookies.txt", f"cookiefile 应被设置,opts={captured_opts_download}"
assert (
captured_opts_download.get("cookiefile") == "/tmp/fake_cookies.txt"
), f"cookiefile 应被设置,opts={captured_opts_download}"
def test_ydl_opts_no_cookiefile_when_file_missing(fake_user):
@@ -369,7 +371,9 @@ def test_ydl_opts_no_cookiefile_when_file_missing(fake_user):
):
scripts_ai.extract_from_douyin(request=body, current_user=fake_user, db=mock.MagicMock())
assert "cookiefile" not in captured_opts_download, f"cookies 文件缺失时不应设置 cookiefileopts={captured_opts_download}"
assert (
"cookiefile" not in captured_opts_download
), f"cookies 文件缺失时不应设置 cookiefileopts={captured_opts_download}"
def test_generic_download_error_hides_raw_message(fake_user):