test(P3-1): 第52波 domain 单测 - config_schemas/filter_presets/transition_presets(+129) #842
Reference in New Issue
Block a user
Delete Branch "test/wave52-domain-configschemas-filterpresets-transitionpresets"
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?
变更内容
覆盖模块
测试统计
新增 129 个单测,全部通过
代码审查结果 - PR #842
⚠️ 问题(1个需要修改)
test_intensity_clamped逻辑验证不充分assert build_ffmpeg_filter("filter_brighten", 150) == build_ffmpeg_filter("filter_brighten", 100)。💡 建议(2个可选)
tests/unit/test_filter_presets.py 第77行:异常捕获过于宽泛
test_frozen_immutable中使用了pytest.raises(Exception)。这会捕获所有异常,包括AttributeError等,可能掩盖非预期的错误类型。建议明确指定预期的异常类型,如dataclasses.FrozenInstanceError或 Pydantic 对应的ValidationError(取决于具体实现)。tests/unit/test_filter_presets.py 第166行:测试数据依赖性可能导致测试覆盖缺失
test_search_by_tag依赖于运行时FILTER_PRESET_LIBRARY中是否存在带标签的预设。如果预设库数据变更导致tagged为空,测试会静默通过,从而未实际验证标签搜索功能。建议使用pytest.skip在无数据时跳过,或者使用 mock/fixture 确保测试数据存在。✅ 格式检查通过 | ❌ 逻辑审查需修改 | ✅ 性能良好
🤖 由 AI 代码审查机器人自动生成 | 2026-07-24 12:37:37 | 模型:
🗑️ 预览环境已清理
PR #842 已关闭或合并,对应的预览环境已被清理。