Skip to content

Commit 4ebee1b

Browse files
mldangeloclaude
andcommitted
test: add comprehensive pytest suite for CLI wrapper
Add 46 comprehensive tests covering all CLI wrapper functionality: Unit Tests: - Node.js and npx detection - Path normalization and quote handling - argv[0] resolution logic - Windows-specific promptfoo discovery - External promptfoo detection with recursion prevention - Shell requirement detection for .bat/.cmd files - Command execution with proper environment passing Integration Tests: - main() function with all execution paths - Error handling when Node.js not installed - External promptfoo usage with wrapper env var - Fallback to npx when no external promptfoo - Argument passing and exit code propagation Platform-Specific: - Windows shell extensions for .bat/.cmd files - Windows-specific tests (skipped on non-Windows) - Unix behavior verification Test Results: 43 passed, 3 skipped (Windows-only tests on macOS) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent d98fd37 commit 4ebee1b

File tree

2 files changed

+500
-0
lines changed

2 files changed

+500
-0
lines changed

tests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Tests for the promptfoo Python wrapper."""

0 commit comments

Comments
 (0)