Skip to main content

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

ClimApp uses pytest for automated testing. The suite is configured via 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:
pytest -v
To run a single test file in isolation:
pytest tests/test_validators.py -v
1

Install dependencies

Make sure your virtual environment is active and all packages from requirements.txt are installed before running tests.
pip install -r requirements.txt
2

Run the full suite

Execute all tests from the project root. pytest reads pytest.ini automatically and scans the tests/ directory.
pytest -v
3

Run a specific file

When working on a particular module, target its test file directly to keep feedback fast.
pytest tests/test_validators.py -v
4

Review and fix failures

pytest prints a summary of failures at the end of the run. Fix the reported assertions, then re-run the affected file to confirm the fix before running the full suite again.

Test files

The tests/ directory contains the following test modules:
FileWhat it covers
test_validators.pyUnit 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.pyBusiness-logic layer tests covering WeatherAPIService, NormalizerService, AlertService, and RetryService.
test_normalizer.pyTests that NormalizerService correctly transforms raw AEMET API responses into the internal RegistroClimatico model format.
test_api_service.pyTests for the AEMET double-handshake request flow, including retry behaviour and handling of temporary download URLs.
test_json_repository.pyTests for JSONRepository read/write operations against the /data folder, including edge cases for missing or malformed files.
test_compare_controller.pyIntegration tests for the /comparar module, verifying that temperature, humidity, wind, and rainfall differentials are computed correctly between manual records and AEMET reference data.

Build docs developers (and LLMs) love