GestionTablets/RUNNING.md
ijuanes 85978a710f 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
2026-06-17 17:10:12 +01:00

1.8 KiB

Tablet Management System - Running

Status: Application is running successfully!

Access Information

How to Use

Web Interface

  1. Open your browser to: http://localhost:5000
  2. Use the navigation menu to:
    • Home: View available tablets and active loans
    • Add Tablet: Add new tablets to inventory
    • Add User: Register new users
    • Loan Tablet: Loan a tablet to a user
    • Loan History: View complete loan history

Command Line (Alternative)

If you prefer command line:

# Run the interactive application
python3 minimal_app.py

# Run the test/demo
python3 test_app.py

Current Data

The system already contains test data:

  • 3 Tablets: Samsung Galaxy Tab S7, Apple iPad Pro, Lenovo Tab P11
  • 3 Users: John Doe, Jane Smith, Bob Johnson
  • 2 Loans: One active, one returned

Stopping the Server

To stop the Flask application:

pkill -f "python app.py"

Technical Details

  • Backend: SQLite 3
  • Frontend: Flask with HTML/CSS
  • Port: 5000 (configurable in app.py)
  • Virtual Environment: .venv/ (created with uv)

Running Tests

The project includes 46 unit tests for verifying functionality:

# 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.