generated from personal-projects/leo-claude-mktplace
Create test suite for wrapper functionality
This commit implements a comprehensive test suite for the HTTP wrapper components. Test coverage: - test_config.py: Configuration loader and validation tests - Required field validation - URL validation and formatting - Port range validation - Tool list parsing (enabled/disabled) - Environment variable generation - .env file loading - test_filtering.py: Tool filtering tests - Passthrough mode (no filtering) - Whitelist mode (enabled_tools) - Blacklist mode (disabled_tools) - Tool list filtering - MCP response filtering - Edge cases (empty lists, missing names) - test_middleware.py: HTTP authentication tests - BearerAuthMiddleware with/without token - Valid/invalid token handling - Missing/malformed Authorization headers - HTTP status codes (401, 403) - HealthCheckBypassMiddleware - Custom health check paths - Middleware ordering Test infrastructure: - conftest.py: Shared fixtures for common test data - pytest.ini: Test configuration and markers - Updated dev dependencies with test frameworks Test execution: - Run all tests: pytest - Run with coverage: pytest --cov=gitea_http_wrapper - Run specific test: pytest src/gitea_http_wrapper/tests/test_config.py This test suite validates all wrapper components except the main server (which would require integration tests with a real Gitea MCP server). Closes #17 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
18
pytest.ini
Normal file
18
pytest.ini
Normal file
@@ -0,0 +1,18 @@
|
||||
[pytest]
|
||||
testpaths = src/gitea_http_wrapper/tests
|
||||
python_files = test_*.py
|
||||
python_classes = Test*
|
||||
python_functions = test_*
|
||||
asyncio_mode = auto
|
||||
|
||||
# Coverage options
|
||||
addopts =
|
||||
--verbose
|
||||
--strict-markers
|
||||
--tb=short
|
||||
|
||||
# Markers for test categorization
|
||||
markers =
|
||||
unit: Unit tests (fast, no external dependencies)
|
||||
integration: Integration tests (may require external services)
|
||||
slow: Slow-running tests
|
||||
Reference in New Issue
Block a user