test: add comprehensive unit test suite
- 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
This commit is contained in:
parent
d3d1fb1b32
commit
83ac67fea2
7 changed files with 1575 additions and 0 deletions
2
tests/requirements.txt
Normal file
2
tests/requirements.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
pytest==8.3.2
|
||||
pytest-cov==5.0.0
|
||||
Loading…
Add table
Add a link
Reference in a new issue