fix: rule_signature conditions=None防御 + 0行表格覆盖率 + 23个新UT - Closes #21 #32

Merged
pzhang_zywl merged 1 commits from dev/issue-21-unit-tests-and-edge-cases into main 2026-06-01 13:31:04 +08:00
Owner

Summary

  • step3 rule_signature: trigger.conditions=None 时使用 防御 TypeError
  • step1 _quick_validate: total_rows=0 时行覆盖率设为 100% 而非 0%(避免误报)
  • test_step1: 新增 12 个纯逻辑 UT(TestHasSectionContent + TestQuickValidateEmptySections)
  • test_step3: 新增 11 个纯逻辑 UT(TestRuleSignature + TestNormalizeRule)

Test

  • pytest 全量通过 (102 passed, 13 skipped)
  • 新增 23 个单元测试 — 不依赖 LLM 输出,纯逻辑验证
  • 覆盖: _has_section_content, _quick_validate, rule_signature, _normalize_rule

Closes #21

[da-0601-0914]

## Summary - step3 rule_signature: trigger.conditions=None 时使用 防御 TypeError - step1 _quick_validate: total_rows=0 时行覆盖率设为 100% 而非 0%(避免误报) - test_step1: 新增 12 个纯逻辑 UT(TestHasSectionContent + TestQuickValidateEmptySections) - test_step3: 新增 11 个纯逻辑 UT(TestRuleSignature + TestNormalizeRule) ## Test - [x] pytest 全量通过 (102 passed, 13 skipped) - [x] 新增 23 个单元测试 — 不依赖 LLM 输出,纯逻辑验证 - [x] 覆盖: _has_section_content, _quick_validate, rule_signature, _normalize_rule Closes #21 [da-0601-0914]
pzhang_zywl added 1 commit 2026-06-01 13:30:24 +08:00
- step3 rule_signature: trigger.conditions=None 时使用 `or []` 防御
- step1 _quick_validate: total_rows=0 时行覆盖率设为 100% 而非 0%
- test_step1: 新增 TestHasSectionContent (10个) + TestQuickValidateEmptySections (2个)
- test_step3: 新增 TestRuleSignature (7个) + TestNormalizeRule (4个)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
pzhang_zywl merged commit ddcb6c6a45 into main 2026-06-01 13:31:04 +08:00
Sign in to join this conversation.