feat: 添加 doc/xls/ppt 旧格式文档支持
- 新增 DocReader,支持 markitdown 和 pypandoc-binary 解析器 - 新增 XlsReader,支持 unstructured、markitdown 和 pandas+xlrd 解析器 - 新增 PptReader,支持 markitdown 解析器 - 添加 olefile 依赖用于验证 OLE2 格式 - 更新 config.py 添加 doc/xls/ppt 依赖配置 - 更新 --advice 支持 doc/xls/ppt 格式 - 添加相应的测试用例 - 同步 specs 到主目录
This commit is contained in:
21
tests/test_readers/test_doc/test_consistency.py
Normal file
21
tests/test_readers/test_doc/test_consistency.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""测试所有 DOC Readers 的一致性。"""
|
||||
|
||||
import pytest
|
||||
from readers.doc import markitdown, pypandoc
|
||||
|
||||
|
||||
class TestDocReadersConsistency:
|
||||
"""验证 DOC Readers 模块结构正确。"""
|
||||
|
||||
def test_parsers_importable(self):
|
||||
"""测试所有 parser 模块可以正确导入。"""
|
||||
# 验证模块导入成功
|
||||
assert markitdown is not None
|
||||
assert pypandoc is not None
|
||||
assert hasattr(markitdown, 'parse')
|
||||
assert hasattr(pypandoc, 'parse')
|
||||
|
||||
def test_parser_functions_callable(self):
|
||||
"""测试 parse 函数是可调用的。"""
|
||||
assert callable(markitdown.parse)
|
||||
assert callable(pypandoc.parse)
|
||||
Reference in New Issue
Block a user