feat: 添加 doc/xls/ppt 旧格式文档静态测试文件支持
- 更新 .gitattributes,将 fixtures 目录所有文件纳入 Git LFS - 在 tests/test_readers/conftest.py 中添加静态文件 fixtures - 添加 doc/xls/ppt 静态测试文件(9个文件) - 更新各旧格式解析器测试用例使用静态文件 - 更新一致性测试使用静态文件 - 在 README.md 中添加 fixtures 使用规范 - 同步 delta specs 到主 specs(doc-reader/xls-reader/ppt-reader/reader-testing/test-fixtures) - 归档 add-static-test-fixtures 变更
This commit is contained in:
@@ -23,3 +23,27 @@ class TestMarkitdownDocReaderParse:
|
||||
# 验证返回 None 和错误信息
|
||||
assert content is None
|
||||
assert error is not None
|
||||
|
||||
def test_parse_simple_doc(self, simple_doc_path):
|
||||
"""测试解析简单 DOC 文件。"""
|
||||
content, error = markitdown.parse(simple_doc_path)
|
||||
|
||||
# 只要不崩溃即可,不强制要求成功解析
|
||||
if content is not None:
|
||||
assert len(content.strip()) > 0
|
||||
|
||||
def test_parse_with_headings_doc(self, with_headings_doc_path):
|
||||
"""测试解析带标题的 DOC 文件。"""
|
||||
content, error = markitdown.parse(with_headings_doc_path)
|
||||
|
||||
# 只要不崩溃即可
|
||||
if content is not None:
|
||||
assert len(content.strip()) > 0
|
||||
|
||||
def test_parse_with_table_doc(self, with_table_doc_path):
|
||||
"""测试解析带表格的 DOC 文件。"""
|
||||
content, error = markitdown.parse(with_table_doc_path)
|
||||
|
||||
# 只要不崩溃即可
|
||||
if content is not None:
|
||||
assert len(content.strip()) > 0
|
||||
|
||||
Reference in New Issue
Block a user