From c92e54722f6454880305c68ad4f39c0c8c5768ef Mon Sep 17 00:00:00 2001 From: Julien Perrochet Date: Thu, 9 Nov 2023 15:44:31 +0100 Subject: [PATCH] [uss_qualifier] dss_wrapper's handle_query_result function is made public --- .../astm/netrid/common/dss/isa_validation.py | 6 +-- .../scenarios/astm/netrid/dss_wrapper.py | 48 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/monitoring/uss_qualifier/scenarios/astm/netrid/common/dss/isa_validation.py b/monitoring/uss_qualifier/scenarios/astm/netrid/common/dss/isa_validation.py index 5cf8136fb6..8486e69225 100644 --- a/monitoring/uss_qualifier/scenarios/astm/netrid/common/dss/isa_validation.py +++ b/monitoring/uss_qualifier/scenarios/astm/netrid/common/dss/isa_validation.py @@ -256,7 +256,7 @@ def _isa_missing_outline(self, create_isa_url: str, json_body: Dict[str, Any]): rid_query.set_participant_id(self._dss_wrapper.participant_id) - self._dss_wrapper._handle_query_result( + self._dss_wrapper.handle_query_result( check=check, q=rid_query, fail_msg="ISA Creation with missing outline has unexpected result code", @@ -290,7 +290,7 @@ def _isa_missing_volume(self, create_isa_url: str, json_body: Dict[str, Any]): rid_query.set_participant_id(self._dss_wrapper.participant_id) - self._dss_wrapper._handle_query_result( + self._dss_wrapper.handle_query_result( check=check, q=rid_query, fail_msg="ISA Creation with missing outline has unexpected result code", @@ -319,7 +319,7 @@ def _isa_missing_extents(self, create_isa_url: str, json_body: Dict[str, Any]): else: raise ValueError(f"Unknown RID version: {self._dss.rid_version}") - self._dss_wrapper._handle_query_result( + self._dss_wrapper.handle_query_result( check=check, q=rid_query, fail_msg="ISA Creation with missing outline has unexpected result code", diff --git a/monitoring/uss_qualifier/scenarios/astm/netrid/dss_wrapper.py b/monitoring/uss_qualifier/scenarios/astm/netrid/dss_wrapper.py index d49d9048c1..c6a83bfad1 100644 --- a/monitoring/uss_qualifier/scenarios/astm/netrid/dss_wrapper.py +++ b/monitoring/uss_qualifier/scenarios/astm/netrid/dss_wrapper.py @@ -76,7 +76,7 @@ def _handle_query_error( query_timestamps=[q.request.timestamp for q in e.queries], ) - def _handle_query_result( + def handle_query_result( self, check: PendingCheck, q: RIDQuery, @@ -127,7 +127,7 @@ def search_isas( session=self._dss.client, participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( main_check, isas, f"Failed to search ISAs in {area} from {start_time} to {end_time}", @@ -178,7 +178,7 @@ def search_isas_expect_response_code( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check=main_check, q=isas, required_status_code=expected_error_codes, @@ -208,7 +208,7 @@ def get_isa( participant_id=self._dss.participant_id, ) - self._handle_query_result(check, isa, f"Failed to get ISA {isa_id}") + self.handle_query_result(check, isa, f"Failed to get ISA {isa_id}") if isa_id != isa.isa.id: check.record_failed( @@ -247,7 +247,7 @@ def get_isa_expect_response_code( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check=check, q=isa, required_status_code=expected_error_codes, @@ -284,7 +284,7 @@ def put_isa_expect_response_code( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check=check, q=mutated_isa.dss_query, fail_msg="ISA Put succeeded when expecting a failure", @@ -327,7 +327,7 @@ def put_isa( utm_client=self._dss.client, participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( main_check, mutated_isa.dss_query, f"Failed to insert ISA {isa_id}" ) for notification_query in mutated_isa.notifications.values(): @@ -458,7 +458,7 @@ def del_isa( utm_client=self._dss.client, participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( main_check, del_isa.dss_query, f"Failed to delete ISA {isa_id}" ) for notification_query in del_isa.notifications.values(): @@ -544,7 +544,7 @@ def del_isa_expect_response_code( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check=main_check, q=del_isa.dss_query, required_status_code=expected_error_codes, @@ -572,7 +572,7 @@ def cleanup_isa( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check, isa, f"Failed to get ISA {isa_id}", {404, 200}, Severity.Medium ) @@ -587,7 +587,7 @@ def cleanup_isa( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check, del_isa.dss_query, f"Failed to delete ISA {isa_id}", @@ -621,7 +621,7 @@ def search_subs_expect_response_code( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check=check, q=subs, fail_msg=f"Search for subscriptions in area {area} failed to yield a result code in {expected_codes}", @@ -654,7 +654,7 @@ def search_subs( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check, subs, f"Failed to search subscriptions in {area}" ) return subs @@ -683,7 +683,7 @@ def get_sub_expect_response_code( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check=check, q=sub, fail_msg=f"The request to get subscription with ID {sub_id} yielded a response code that wasn't in {expected_response_codes}", @@ -718,7 +718,7 @@ def get_sub( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check, sub, f"Failed to get subscription {sub_id}" ) @@ -758,7 +758,7 @@ def no_sub( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check, sub, f"Failed to get subscription {sub_id}", {404} ) return @@ -801,7 +801,7 @@ def put_sub_expect_response_code( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check=check, q=created_sub, required_status_code=expected_error_codes, @@ -850,7 +850,7 @@ def put_sub( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check, created_sub, f"Failed to insert subscription {sub_id}" ) return created_sub @@ -883,7 +883,7 @@ def del_sub_expect_response_code( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check=check, q=del_sub, fail_msg=f"Query to delete subscription with ID {sub_id} wit not yield a response code in {expected_response_codes}", @@ -918,7 +918,7 @@ def del_sub( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check, del_sub, f"Failed to delete subscription {sub_id}" ) @@ -963,7 +963,7 @@ def cleanup_subs_in_area( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check, del_sub, f"Failed to delete subscription {sub}", @@ -996,7 +996,7 @@ def cleanup_sub( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check, sub, f"Failed to get subscription {sub_id}", @@ -1018,7 +1018,7 @@ def cleanup_sub( participant_id=self._dss.participant_id, ) - self._handle_query_result( + self.handle_query_result( check, del_sub, f"Failed to delete subscription {sub_id}", @@ -1075,7 +1075,7 @@ def raw_request_with_expected_code( else: raise ValueError(f"Unknown RID version: {self._dss.rid_version}") - self._handle_query_result( + self.handle_query_result( check, rid_query, fail_msg,