docs: 完善测试文档和 XLS 格式说明

- 补充测试目录结构说明
- 添加完整的运行所有测试命令
- 增加 Core/Utils/HTML 下载器测试说明
- SKILL.md 中补充 XLS 格式支持信息

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 20:12:42 +08:00
parent a578c0b7ac
commit 3b2b368db2
2 changed files with 74 additions and 4 deletions

View File

@@ -136,16 +136,52 @@ uv run \
### 如何测试
项目包含完整的测试套件,覆盖 CLI 和所有 Reader 实现。根据测试类型使用对应的 `uv run --with` 命令。
项目包含完整的测试套件,覆盖 CLI、核心模块、工具函数和所有 Reader 实现。根据测试类型使用对应的 `uv run --with` 命令。
#### 测试目录结构
- tests/test_cli/ - CLI 功能测试
- tests/test_core/ - 核心模块测试markdown, parser, advice_generator
- tests/test_readers/ - 各格式 Reader 测试
- tests/test_utils/ - 工具函数测试file_detection, encoding_detection
#### 运行所有测试
```bash
uv run \
--with pytest \
--with pytest-cov \
--with docling \
--with "unstructured[pdf]" \
--with "unstructured[docx]" \
--with "unstructured[xlsx]" \
--with "unstructured[pptx]" \
--with "markitdown[pdf]" \
--with "markitdown[docx]" \
--with "markitdown[xlsx]" \
--with "markitdown[pptx]" \
--with "markitdown[xls]" \
--with pypdf \
--with markdownify \
--with reportlab \
--with pypandoc-binary \
--with python-docx \
--with python-pptx \
--with pandas \
--with tabulate \
--with xlrd \
--with olefile \
--with trafilatura \
--with domscribe \
--with html2text \
--with beautifulsoup4 \
--with httpx \
--with chardet \
--with pyppeteer \
--with selenium \
pytest
```
注:由于依赖较多,也可以按测试类别分别运行(见下文)。
#### 测试 DOCX reader
```bash
uv run \
@@ -236,6 +272,39 @@ uv run \
pytest tests/test_readers/test_xls/
```
#### 测试 Core 模块
```bash
# 测试核心模块(无需额外依赖)
uv run \
--with pytest \
pytest tests/test_core/
```
#### 测试 Utils 模块
```bash
# 测试工具函数(无需额外依赖)
uv run \
--with pytest \
pytest tests/test_utils/
```
#### 测试 HTML 下载器
```bash
# 测试 HTML 下载器
uv run \
--with pytest \
--with trafilatura \
--with domscribe \
--with markitdown \
--with html2text \
--with beautifulsoup4 \
--with httpx \
--with chardet \
--with pyppeteer \
--with selenium \
pytest tests/test_readers/test_html_downloader.py
```
#### 运行特定测试文件或方法
```bash
# 运行特定测试文件CLI 测试无需额外依赖)