From ab0b446f399834d3d59e7ad7ca548009d35ecb87 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 28 Aug 2024 15:21:54 +0100 Subject: [PATCH] Fixed check in step 5 of TC-SEAR-1.2 (#35221) * Fixed check in step 5 of TC-SEAR-1.2 * Fixed check for EstimatedEndTime being not null in step 6. --- src/python_testing/TC_SEAR_1_2.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py index c21e831464557e..1c08b87cad2bf5 100644 --- a/src/python_testing/TC_SEAR_1_2.py +++ b/src/python_testing/TC_SEAR_1_2.py @@ -140,10 +140,10 @@ async def read_and_validate_current_area(self, step): endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.CurrentArea) logging.info(f"CurrentArea {current_area}") - asserts.assert_true((len(self.selareaid_list) == 0 and current_area is NullValue) - or - current_area in self.selareaid_list, - f"CurrentArea {current_area} is invalid. SelectedAreas is {self.selareaid_list}.") + if current_area is not NullValue: + asserts.assert_true(current_area in self.areaid_list, + f"CurrentArea {current_area} is not in SupportedAreas: {self.areaid_list}.") + # save so other methods can use this if needed self.current_area = current_area @@ -158,7 +158,8 @@ async def read_and_validate_estimated_end_time(self, step): if self.current_area is NullValue: asserts.assert_true(estimated_end_time is NullValue, "EstimatedEndTime should be null if CurrentArea is null.") - else: + + if estimated_end_time is not NullValue: # allow for some clock skew asserts.assert_true(estimated_end_time >= read_time - 3*60, f"EstimatedEndTime({estimated_end_time}) should be greater than the time when it was read({read_time})")