From 5d8fa7742aa0d50a653692e6fa9a64fc91985c5f Mon Sep 17 00:00:00 2001 From: Benjamin Pelletier Date: Sun, 5 Nov 2023 01:06:13 +0000 Subject: [PATCH] Fix residual errors --- monitoring/mock_uss/f3548v21/flight_planning.py | 7 ++++++- monitoring/mock_uss/uspace/flight_auth.py | 4 +++- monitoring/uss_qualifier/reports/tested_requirements.py | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/monitoring/mock_uss/f3548v21/flight_planning.py b/monitoring/mock_uss/f3548v21/flight_planning.py index 9e26962d73..4a7f585e25 100644 --- a/monitoring/mock_uss/f3548v21/flight_planning.py +++ b/monitoring/mock_uss/f3548v21/flight_planning.py @@ -242,10 +242,15 @@ def op_intent_from_flightinfo( uss_base_url="{}/mock/scd".format(webapp.config[KEY_BASE_URL]), subscription_id="UNKNOWN", ) + if "astm_f3548_21" in flight_info and flight_info.astm_f3548_21: + priority = flight_info.astm_f3548_21.priority + else: + # TODO: Ensure this function is only called when sufficient information is available, or raise ValueError + priority = 0 details = f3548_v21.OperationalIntentDetails( volumes=volumes, off_nominal_volumes=off_nominal_volumes, - priority=flight_info.astm_f3548_21.priority, + priority=priority, ) return f3548_v21.OperationalIntent( reference=reference, diff --git a/monitoring/mock_uss/uspace/flight_auth.py b/monitoring/mock_uss/uspace/flight_auth.py index d0d88ffe2b..9929b9306f 100644 --- a/monitoring/mock_uss/uspace/flight_auth.py +++ b/monitoring/mock_uss/uspace/flight_auth.py @@ -9,6 +9,8 @@ def validate_request(flight_info: FlightInfo) -> None: Args: flight_info: Information about the requested flight. """ - problems = problems_with_flight_authorisation(flight_info.flight_authorisation) + problems = problems_with_flight_authorisation( + flight_info.uspace_flight_authorisation + ) if problems: raise PlanningError(", ".join(problems)) diff --git a/monitoring/uss_qualifier/reports/tested_requirements.py b/monitoring/uss_qualifier/reports/tested_requirements.py index 3c61d1c75f..acb0abdbb4 100644 --- a/monitoring/uss_qualifier/reports/tested_requirements.py +++ b/monitoring/uss_qualifier/reports/tested_requirements.py @@ -185,8 +185,8 @@ class TestedBreakdown(ImplicitDict): class TestRunInformation(ImplicitDict): test_run_id: str - start_time: Optional[str] - end_time: Optional[str] + start_time: Optional[str] = None + end_time: Optional[str] = None baseline: str environment: str