style: black format test files
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m38s
AI Code Review / AI Code Review (pull_request) Successful in 2m14s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 5m43s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 6m46s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 14s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 1386h51m4s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 1386h52m36s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 1386h52m38s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 1386h52m39s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 1386h52m40s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1386h52m41s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 1386h52m38s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 1386h52m43s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 1386h52m38s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 1386h52m43s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 1386h52m43s
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 1387h24m50s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1387h24m48s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m38s
AI Code Review / AI Code Review (pull_request) Successful in 2m14s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 5m43s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 6m46s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 14s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 1386h51m4s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 1386h52m36s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 1386h52m38s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 1386h52m39s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 1386h52m40s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1386h52m41s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 1386h52m38s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 1386h52m43s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 1386h52m38s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 1386h52m43s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 1386h52m43s
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 1387h24m50s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1387h24m48s
This commit is contained in:
@@ -144,6 +144,7 @@ class TestExtractCoverFromClip:
|
||||
|
||||
# mock _extract_frame 避免真的调 ffmpeg
|
||||
with patch.object(CoverService, "_extract_frame") as mock_extract:
|
||||
|
||||
def fake_extract(video_path, output_path, **kwargs):
|
||||
# 创建假的封面文件
|
||||
with open(output_path, "wb") as f:
|
||||
@@ -154,9 +155,7 @@ class TestExtractCoverFromClip:
|
||||
with pytest.raises(RuntimeError, match="上传封面失败"):
|
||||
service.extract_cover_from_clip(plan_id="plan-1", asset_id="asset-1")
|
||||
|
||||
def test_extract_cover_get_url_falls_back_to_key(
|
||||
self, service, mock_asset_repo, mock_storage, video_asset
|
||||
):
|
||||
def test_extract_cover_get_url_falls_back_to_key(self, service, mock_asset_repo, mock_storage, video_asset):
|
||||
"""测试获取 URL 失败时降级为 storage_key"""
|
||||
mock_asset_repo.get.return_value = video_asset
|
||||
|
||||
@@ -169,15 +168,14 @@ class TestExtractCoverFromClip:
|
||||
mock_storage.get_url.side_effect = Exception("URL服务不可用")
|
||||
|
||||
with patch.object(CoverService, "_extract_frame") as mock_extract:
|
||||
|
||||
def fake_extract(video_path, output_path, **kwargs):
|
||||
with open(output_path, "wb") as f:
|
||||
f.write(b"\xff\xd8\xff\xe0fake jpeg")
|
||||
|
||||
mock_extract.side_effect = fake_extract
|
||||
|
||||
result = service.extract_cover_from_clip(
|
||||
plan_id="plan-abc", asset_id="asset-xyz", frame_time=2.5
|
||||
)
|
||||
result = service.extract_cover_from_clip(plan_id="plan-abc", asset_id="asset-xyz", frame_time=2.5)
|
||||
|
||||
assert result["type"] == "manual"
|
||||
assert result["frame_time"] == 2.5
|
||||
@@ -197,6 +195,7 @@ class TestExtractCoverFromClip:
|
||||
mock_storage.download_file.side_effect = fake_download
|
||||
|
||||
with patch.object(CoverService, "_extract_frame") as mock_extract:
|
||||
|
||||
def fake_extract(video_path, output_path, **kwargs):
|
||||
with open(output_path, "wb") as f:
|
||||
f.write(b"\xff\xd8\xff\xe0fake jpeg image data")
|
||||
|
||||
@@ -169,9 +169,7 @@ class TestLoginUseCase:
|
||||
assert response is None
|
||||
assert error == "Invalid email or password"
|
||||
|
||||
def test_login_legacy_sha256_password_success_and_upgrade(
|
||||
self, use_case, mock_user_repo, mock_session_store
|
||||
):
|
||||
def test_login_legacy_sha256_password_success_and_upgrade(self, use_case, mock_user_repo, mock_session_store):
|
||||
"""测试旧版 SHA256 密码登录成功并自动升级哈希"""
|
||||
legacy_hash = _legacy_sha256("OldPassword123")
|
||||
legacy_user = User(
|
||||
|
||||
Reference in New Issue
Block a user