docs: add testing documentation to README and RUNNING.md
- Add Testing section to README with: - How to run tests - Test structure overview - Key edge cases covered - Test configuration notes - Add Running Tests section to RUNNING.md - Document the 46 unit tests available
This commit is contained in:
parent
83ac67fea2
commit
85978a710f
2 changed files with 56 additions and 13 deletions
24
RUNNING.md
24
RUNNING.md
|
|
@ -48,10 +48,22 @@ pkill -f "python app.py"
|
|||
- **Port**: 5000 (configurable in app.py)
|
||||
- **Virtual Environment**: `.venv/` (created with uv)
|
||||
|
||||
## Troubleshooting
|
||||
If you have issues:
|
||||
1. Check if the server is running: `ps aux | grep app.py`
|
||||
2. Check the database: `sqlite3 tablets.db`
|
||||
3. Restart the server: `source .venv/bin/activate && python app.py`
|
||||
## Running Tests
|
||||
|
||||
Enjoy managing your tablets! 📱💻
|
||||
The project includes 46 unit tests for verifying functionality:
|
||||
|
||||
```bash
|
||||
# Run all tests
|
||||
python3 -m pytest tests/ -v
|
||||
|
||||
# Run with coverage
|
||||
python3 -m pytest tests/ --cov=./ --cov-report=term-missing
|
||||
```
|
||||
|
||||
Tests cover:
|
||||
- Core CRUD operations for tablets, users, and loans
|
||||
- Edge cases (duplicates, invalid IDs, already loaned devices)
|
||||
- Application function testing
|
||||
- Non-loanable device management
|
||||
|
||||
All tests use isolated temporary databases and do not affect production data.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue