Testing Guide
Running Tests
The project uses pytest for testing. To run the test suite:
pytest tests/
Test Structure
Model Tests (tests/test_models.py)
- Tests for the ControlTable model
- Status transition validation
- Default values and constraints
API Tests (tests/test_api.py)
- Endpoint testing
- Request validation
- Error handling
- Bulk operations
Writing Tests
- Use the provided fixtures in
conftest.py - Follow the existing test patterns
- Include both positive and negative test cases
- Test edge cases and error conditions
Test Database
Tests use SQLite in-memory database by default. The test configuration automatically creates and tears down the database for each test.