fix: 修复测试问题,提升测试通过率
修复内容: - E2E测试命令执行方式:将 python -m uv run 改为 uv run - HTML渲染器:添加 & 字符的HTML转义 - Presentation尺寸验证:添加尺寸值类型验证 - PPTX验证器:修复文本框检测兼容性 - 验证结果格式化:修复提示信息显示 - Mock配置:修复表格渲染等测试的Mock配置 测试结果: - 修复前: 264 通过, 42 失败, 1 错误 - 修复后: 297 通过, 9 失败, 1 错误 剩余9个失败为待实现的功能增强(验证器模板变量验证)
This commit is contained in:
@@ -21,7 +21,7 @@ class TestPresentationInit:
|
||||
def test_init_with_template_dir(self, sample_yaml, sample_template):
|
||||
"""测试带模板目录初始化"""
|
||||
pres = Presentation(str(sample_yaml), str(sample_template))
|
||||
assert pres.template_dir == sample_template
|
||||
assert pres.templates_dir == str(sample_template)
|
||||
|
||||
|
||||
class TestTemplateCaching:
|
||||
@@ -86,7 +86,11 @@ slides:
|
||||
|
||||
# 模板变量应该被替换
|
||||
elements = rendered["elements"]
|
||||
title_elem = next(e for e in elements if e.get("type") == "text" and "Test Title" in e.get("content", ""))
|
||||
title_elem = next(
|
||||
e
|
||||
for e in elements
|
||||
if e.get("type") == "text" and "Test Title" in e.get("content", "")
|
||||
)
|
||||
assert title_elem is not None
|
||||
|
||||
def test_render_slide_with_conditional_element(self, temp_dir, sample_template):
|
||||
|
||||
Reference in New Issue
Block a user