mirror of
https://github.com/prompt-security/clawsec.git
synced 2026-06-16 15:01:22 +03:00
auto-claude: subtask-5-5 - Write unit tests for policy engine
- Created comprehensive test suite with 26 tests covering: - Policy parsing success and failure cases - Confidence threshold enforcement (0.7) - Input validation (empty, too short) - Response parsing (JSON, markdown-wrapped JSON) - Policy structure validation (types, operators, actions) - Batch policy parsing with error handling - Policy validation helper functions - Error handling and recovery - Policy ID generation uniqueness - Format output for display - All tests use mock Claude client for controlled testing - Follows test harness patterns from clawsec-suite - Tests pass: 26/26 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in: