Files
herel 9c7f2bde11 ref(frontend): Replace Bootstrap with Tailwind CSS
Swap the Bootstrap CDN for a self-hosted Tailwind CSS build, mirroring
the myice setup: standalone Tailwind CLI v3.4.17, a one-off build-css.sh
script, and a gitignored generated style.css.

- Add tailwind.config.js, style-input.css, build-css.sh at repo root
- Rewrite templates/index.html: drop Bootstrap link/script, link
  /style.css, convert all classes to Tailwind utilities; showAlert now
  uses a class lookup so the JIT scanner detects dynamic classes
- Add /style.css FileResponse route in main.py; drop cdn.jsdelivr.net
  from script-src/style-src in the CSP
- Flip test assertion to assert cdn.jsdelivr.net is absent from CSP

The generated style.css and tailwindcss binary are gitignored; run
./build-css.sh to regenerate (or --watch for dev).
2026-07-08 14:10:37 +02:00
..

Testing

This directory contains tests for the OIDC validator application.

Setup

  1. Run the setup script:
    ./setup_test_env.sh
    

This will create a virtual environment and install all dependencies.

Manual setup

  1. Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
    
  2. Install application dependencies:

    pip install -r requirements.txt
    
  3. Install test dependencies:

    pip install -r requirements-test.txt
    

Running Tests

./run_tests.sh

This will automatically activate the virtual environment and run the tests.

Manual execution

  1. Activate the virtual environment:

    source venv/bin/activate
    
  2. Run tests:

    # Run all tests
    pytest
    
    # Run tests with coverage (excluding tests directory)
    pytest --cov=. --cov-config=.coveragerc
    
    # Run tests with verbose output
    pytest -v
    
  3. Deactivate the virtual environment when done:

    deactivate
    

Coverage Reports

The test suite generates coverage reports to help you understand how well the code is tested:

  • Terminal coverage report is displayed after running tests
  • HTML coverage report is generated in the htmlcov/ directory
  • The coverage configuration excludes the tests directory itself from coverage statistics

Test Structure

  • conftest.py: Contains pytest fixtures shared across tests
  • test_main.py: Tests for the main FastAPI application endpoints
  • test_token_validation.py: Tests for token validation and refresh logic
  • test_utils.py: Tests for utility functions

Test Coverage

The tests cover:

  • Health check endpoint
  • Token validation endpoint
  • Token refresh endpoint
  • Client configuration endpoint
  • Utility functions for OIDC operations
  • Error handling for various failure scenarios
  • Edge cases and invalid inputs