test(wave203): bgm_mixer_pure 单测补全 +88测 #1170
Reference in New Issue
Block a user
Delete Branch "test/wave203-bgm-mixer-pure"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
变更内容
补全BGM混音纯逻辑模块
apps/worker/video_processing/bgm_mixer_pure.py单元测试,覆盖11个纯函数+1个dataclass,新增88个测试用例。覆盖函数
配置数据类 (1个)
BGMPureConfig- 默认配置数据类(9个字段)循环计算 (2个)
should_loop_bgm- 是否需要循环(90%阈值策略)calculate_loop_count- 循环次数(+2余量策略)滤镜构建 (4个)
build_bgm_filter_chain- BGM完整预处理滤镜链(循环/音量/淡入淡出/截断)build_simple_mix_filter- 普通amix两路混音build_sidechain_mix_filter- sidechain人声闪避混音calculate_sidechain_ratio- 闪避比例到FFmpeg ratio映射配置与验证 (2个)
normalize_bgm_config- 配置规范化(类型转换+9项边界钳制)validate_bgm_config- 配置验证(4类参数校验)时长工具 (2个)
calculate_fade_out_start- 淡出开始时间estimate_bgm_processing_duration- 输出时长估算测试数据
🚀 预览环境已部署
AI审查指出的 .gitea/workflows/acr-cleanup.yml 相关问题不在本PR改动范围内。本PR仅新增/修改测试文件,属于纯后端单测补充,不涉及workflow和前端代码。请重新审查PR diff范围内的代码。
【阻塞级判定】
📊 审查概览
🔴 阻塞级问题(必须修复)
无
💡 改进建议(不阻塞合并)
无
✅ 良好实践
from __future__ import annotations和import pytest,保持了代码整洁。video_processing...更新为apps.worker.video_processing...,适应了项目结构变化。assert result == 58.0)替代了pytest.approx,在整数运算场景下更加直观和严谨。✅ 格式检查通过 | ✅ 逻辑审查通过 | ✅ 性能良好
🤖 由 AI 代码审查机器人自动生成 | 2026-07-29 17:18:35 | 模型:
LGTM,纯单测PR,Staging集成测试失败为环境问题
🗑️ 预览环境已清理
PR #1170 已关闭或合并,对应的预览环境已被清理。