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:
2026-03-10 23:09:13 +08:00
parent e53e64d386
commit cf10458dd6
32 changed files with 756 additions and 5 deletions

View File

@@ -38,6 +38,27 @@ class TestCLIAdviceOption:
output = stdout + stderr
assert "无法识别" in output or "错误" in output
def test_advice_option_doc(self, cli_runner):
"""测试 --advice 选项对 DOC 文件。"""
stdout, stderr, exit_code = cli_runner(["test.doc", "--advice"])
assert exit_code == 0
assert "文件类型: DOC" in stdout
def test_advice_option_xls(self, cli_runner):
"""测试 --advice 选项对 XLS 文件。"""
stdout, stderr, exit_code = cli_runner(["test.xls", "--advice"])
assert exit_code == 0
assert "文件类型: XLS" in stdout
def test_advice_option_ppt(self, cli_runner):
"""测试 --advice 选项对 PPT 文件。"""
stdout, stderr, exit_code = cli_runner(["test.ppt", "--advice"])
assert exit_code == 0
assert "文件类型: PPT" in stdout
class TestCLIDefaultOutput:
"""测试 CLI 默认输出功能。"""