Closed amehta-scottlogic closed 3 months ago
How this should work in practice, having confirmed with Ajay
GET request made to /air-pollutant/measurements/summary
with params:
location_type
- city
measurement_base_time
- 2024-06-06T00:00:00+00:00
measurement_time_range
- 90
expecting in the response any measurements from 2024-06-05T22:30:00+00:00
to 2024-06-06T01:30:00+00:00
from any city in the database
UPDATE - median no longer included in ticket
Undertake an initial sense check using Postman
Create automation using Pytest with Request library for functional test cases
POISED testing heuristic applied
Seed data in database as ETL is tested elsewhere, more repeatable outcomes
Parameters:
location_type
is requiredmeasurement_base_time
is requiredmeasurement_time_range
is requiredlocation_type
, measurement_time_range
and measurement_base_time
is status 200location_type
, measurement_time_range
and measurement_base_time
is status 422Output:
Seed data for a specific city
BVA -1.5hrs
measurement_date
-91 mins from measurement_time
is not affecting mean / measurement_date
-90 mins from measurement_time
is affecting mean / measurement_date
-89 mins from measurement_time
is affecting mean / BVA +1.5hrs
measurement_date
+89 mins from measurement_time
is affecting mean / ~~median value returned ~~measurement_date
+90 mins from measurement_time
is affecting mean / measurement_date
+91 mins from measurement_time
is not affecting mean / Manually calculate pollutant level and overall AQI means and medians for a test dataset.
measurement_base_time
is correctly assigned to responseInteroperability:
Security:
Errors:
Data:
Test Charter:
Regression candidate:
Description:
statistic.median()
docs it should be:
Steps to reproduce:
/air-pollutant/measurements/summary?measurement_base_time=2024-07-20T15%3A00%3A00.000%2B00%3A00&measurement_time_range=90&location_type=city
in_situ_data
databaseExpected:
Actual:
Test Data:
API Response:
forecast_api_seeded_data_tests.py
, forecast_api_validation_tests.py
, cams_known_grib_test.py
, forecast_calibration_tests.py
& open_aq_etl_tests.py
tests all passed.
Executed manual test cases, had to make some changes to test assertions, but expected behaviour was observed
measurement_time_range:
Description
The first screen in the dashboard is going to show 10 cities where the forecasted and in situ values are most different. This will be done for a specific
forecast_base_time
andforecast_valid_time
To do this we need to actually calculate this from the data in our database.
Acceptance Criteria
location_type
andmeasurement_base_time
&measurement_time_range
are validated and if not valid we'll return 422location_type
,measurement_base_time
,measurement_time_range
measurement_base_time
Test Checklist: