- Add tests/ directory with pytest configuration - Add conftest.py with database fixtures (test_db, sample data) - Add test_core.py: 21 tests for core operations (tablet, user, loan CRUD) - Add test_edge_cases.py: 14 tests for edge cases (duplicates, invalid IDs, etc.) - Add test_minimal_app.py: 11 tests for actual application functions - Update pyproject.toml with pytest and coverage configuration - Total: 46 tests covering core functionality and edge cases Tests cover: - Tablet CRUD operations - User CRUD operations - Loan/return workflows - Duplicate prevention (serial numbers, identifications) - Invalid ID handling - Already loaned device prevention - Non-existent loan handling - Multiple loans per user (one-to-many relationship) - Non-loanable device CRUD operations To run: python3 -m pytest tests/ -v
2 lines
32 B
Text
2 lines
32 B
Text
pytest==8.3.2
|
|
pytest-cov==5.0.0
|