- ARCH-03: Boss crawler migrated to crawler_core (no inline signatures or HTTP boilerplate) - QUAL-03: 22 mock tests pass covering all Boss API classes - Anti-crawl mechanisms preserved (TLS fingerprint, proxy rotation, 10s delay) - Phase 1 regression: 41 tests still passing
27 lines
889 B
Markdown
27 lines
889 B
Markdown
# Plan 02-02 Summary: Boss HTTP 层 mock 测试
|
||
|
||
**Status:** Complete
|
||
**Tasks:** 2/2
|
||
**Commit:** 5bd4477
|
||
|
||
## What was built
|
||
|
||
创建 `tests/boss/` 目录和 `test_boss_client.py` 测试文件:
|
||
|
||
- **22 个测试用例** 覆盖全部 Boss API 类:
|
||
- `TestParseBossResponse`(7 个):纯函数测试,HTTP 错误、业务错误、列表响应、详情响应
|
||
- `TestSearchRecJobs`(4 个):正常响应、HTTP 403、业务错误、参数构建验证
|
||
- `TestGetBrandDetail`(2 个):正常响应、404
|
||
- `TestSearchBrandJobs`(2 个):hasMore=True/False
|
||
- `TestGetJobDetail`(3 个):batch 子请求合并、业务错误、异常处理
|
||
- `TestBossClientHeaders`(4 个):Traceid 注入、长度验证、mpt/wt2 注入、默认值
|
||
|
||
## Verification
|
||
|
||
```
|
||
22 passed in 0.08s ✅
|
||
41 passed in 0.07s(Phase 1 回归无问题)✅
|
||
```
|
||
|
||
## Self-Check: PASSED
|