ploughshares/tests/README.md

60 lines
1.3 KiB
Markdown

# Ploughshares Tests
This directory contains tests for the Ploughshares application, focusing on:
1. Core functionality testing
2. Code quality verification
3. Dependency vulnerability scanning
## Test Files
- `test_app.py`: Tests core application functionality
- Verifies required imports
- Checks for essential API routes
- `test_code_quality.py`: Enforces code quality standards
- Validates Python syntax
- Checks for improper use of print statements
- Verifies flake8 installation
- `test_dependencies.py`: Scans for vulnerable dependencies
- Checks requirements.txt for known vulnerable packages
- Integrates with safety tool when available
## Running Tests
Run all tests:
```bash
python3 -m pytest
```
Run a specific test file:
```bash
python3 -m pytest test_app.py
```
Run with verbose output:
```bash
python3 -m pytest -v
```
## Required Tools
**IMPORTANT**: The following tools are required for complete testing:
- flake8: Code style checker
- safety: Dependency vulnerability scanner
- bandit: Security issue scanner
Install these tools with:
```bash
../install-codechecks.sh
```
## Pre-commit Integration
These tests are automatically run by the Git pre-commit hook to ensure code quality standards are maintained before allowing commits.