test(unit): P3-1 第五波 新增3个领域模块单元测试(54个用例) #683
Reference in New Issue
Block a user
Delete Branch "test/p3-1-wave5-domain-tests"
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?
P3-1 第五波领域层单元测试补充,覆盖3个模块,共54个测试用例。
🚀 预览环境已部署
CI全绿,自动审批通过。
CI全绿,自动审批通过。
代码审查结果 - PR #683
⚠️ 问题(1个需要修改)
test_create_empty_project_id_raises)期望的错误消息是英文(例如"project_id cannot be empty"),而同 PR 中的其他测试文件(如test_classification_domain.py和test_edit_plan_domain.py)均使用中文错误消息(例如"project_id 不能为空")。这表明该模块的测试用例可能复制自其他项目或未本地化,如果领域模型抛出的是中文异常,这些测试将失败。test_generated_video_domain.py中所有pytest.raises(ValueError, match="...")的英文匹配字符串修改为中文,以保持代码库的一致性。例如将"project_id cannot be empty"改为"project_id 不能为空"。💡 建议(2个可选)
test_existing_voice使用longxiaochun_v3(龙小淳) 作为测试样本,而test_existing_is_preset使用longxiaochen_v3(龙小晨)。虽然这两个 ID 在数据中都存在,但这种不一致容易导致维护混淆。建议定义一个常量SAMPLE_VOICE_ID = "longxiaochun_v3"供多个测试用例复用。test_total_count断言len(PRESET_VOICES) == 8。如果未来新增预置音色,此测试会无故失败。如果业务逻辑不强制限制音色数量为 8 个,建议移除此断言,或改为检查数量大于 0 即可。✅ 格式检查通过 | ❌ 逻辑审查需修改 | ✅ 性能良好
🤖 由 AI 代码审查机器人自动生成 | 2026-07-21 19:35:05 | 模型:
aa350e2b1etod21b16aac7🗑️ 预览环境已清理
PR #683 已关闭或合并,对应的预览环境已被清理。