generated from personal-projects/leo-claude-mktplace
test: add comprehensive test suite - Closes #7
Added comprehensive test coverage for all tool modules: Test Files Created: - tests/conftest.py: Shared fixtures for all tests - tests/test_issues.py: Complete coverage for issue tools - tests/test_labels.py: Complete coverage for label tools - tests/test_milestones.py: Complete coverage for milestone tools Test Coverage: - Tool definition validation (schema structure) - Handler function routing - Successful API response formatting - Error handling (GiteaClientError) - Required parameter validation - Optional parameter handling - Mock Gitea API responses Configuration Updates: - Added pytest-cov>=4.0.0 to dev dependencies - Created run_tests.sh script for easy test execution All tests use pytest-asyncio for async functions and mock the GiteaClient to avoid real API calls. Tests validate tool schemas, handler routing, response formatting, and error handling. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
21
run_tests.sh
Executable file
21
run_tests.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# Test runner script for gitea-mcp-remote
|
||||
|
||||
set -e
|
||||
|
||||
echo "Running gitea-mcp-remote test suite..."
|
||||
echo
|
||||
|
||||
# Install dev dependencies if not already installed
|
||||
if ! command -v pytest &> /dev/null; then
|
||||
echo "Installing dev dependencies..."
|
||||
pip install -e ".[dev]"
|
||||
echo
|
||||
fi
|
||||
|
||||
# Run tests with coverage
|
||||
echo "Running tests with coverage..."
|
||||
python -m pytest tests/ -v --cov=src/gitea_mcp --cov-report=term-missing --cov-report=html
|
||||
|
||||
echo
|
||||
echo "Coverage report saved to htmlcov/index.html"
|
||||
Reference in New Issue
Block a user