ClimApp uses pytest for automated testing. The suite is configured viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/elenacarino-max/mas-climapp/llms.txt
Use this file to discover all available pages before exploring further.
pytest.ini to discover all tests under the tests/ directory and to set the project root on the Python path, so imports resolve correctly without any additional setup.
Running the tests
To run the full suite with verbose output:Recommended workflow
Install dependencies
Make sure your virtual environment is active and all packages from
requirements.txt are installed before running tests.Run the full suite
Execute all tests from the project root. pytest reads
pytest.ini automatically and scans the tests/ directory.Run a specific file
When working on a particular module, target its test file directly to keep feedback fast.
Test files
Thetests/ directory contains the following test modules:
| File | What it covers |
|---|---|
test_validators.py | Unit tests for all functions in utils/validators.py: numeric coercion, date format acceptance, and per-field range validation, plus the validate_weather_data() integration function. |
test_services.py | Business-logic layer tests covering WeatherAPIService, NormalizerService, AlertService, and RetryService. |
test_normalizer.py | Tests that NormalizerService correctly transforms raw AEMET API responses into the internal RegistroClimatico model format. |
test_api_service.py | Tests for the AEMET double-handshake request flow, including retry behaviour and handling of temporary download URLs. |
test_json_repository.py | Tests for JSONRepository read/write operations against the /data folder, including edge cases for missing or malformed files. |
test_compare_controller.py | Integration tests for the /comparar module, verifying that temperature, humidity, wind, and rainfall differentials are computed correctly between manual records and AEMET reference data. |