# Test Suite This directory contains automated tests for the FLARES project. ## Directory Structure ``` tests/ ├── unit/ # Unit tests for individual modules │ ├── test_updater.py # Security-critical updater module tests │ └── ... (more tests TBD) ├── integration/ # Integration tests for multi-component workflows └── fixtures/ # Test data and mock resources ``` ## Running Tests ```bash # Quick way: use the test runner script ./run_tests.sh # Install dependencies (if needed) pip install pytest numpy psutil Pillow # Run all non-GUI unit tests python -m pytest tests/unit/ \ --ignore=tests/unit/test_updater.py \ --ignore=tests/unit/test_plugin_manager.py \ --ignore=tests/unit/test_flares.py \ -v # Run specific test file pytest tests/unit/test_security_utils.py -v ``` **Note**: `test_updater.py`, `test_plugin_manager.py`, and `test_flares.py` require PySide6 (GUI framework) and are skipped by default. ## Test Coverage Status Current test suite: - **security_utils.py**: 30 tests ✅ (all passing) - **auth_utils.py**: 12 tests ✅ (all passing) - **logging_config.py**: 15 tests ✅ (all passing) - **Total**: 57 passing tests See `tests/unit/` for all test files. ## CI/CD Integration Tests automatically run on every push via Gitea Actions: - Workflow: `.gitea/workflows/test.yml` - Status: https://git.research.dezeeuw.ca/hermes/flares/actions ## Writing Tests See existing tests in `tests/unit/test_updater.py` for examples of: - Testing utility functions like `version_compare()` - Mocking external dependencies (QThread, HTTP requests) - Security-focused test cases