Skip to content

Commit

Permalink
fix issues reported by the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
plauric committed Jul 27, 2024
1 parent bfb6629 commit 91c9d5b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/python_testing/TC_SEAR_1_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async def read_and_validate_estimated_end_time(self, step):

if self.current_area is NullValue:
asserts.assert_true(estimated_end_time is NullValue,
f"EstimatedEndTime should be null if CurrentArea is null.")
"EstimatedEndTime should be null if CurrentArea is null.")
else:
#allow for some clock skew
asserts.assert_true(estimated_end_time >= read_time - 3*60,
Expand Down Expand Up @@ -265,7 +265,7 @@ async def test_TC_SEAR_1_2(self):

await self.read_and_validate_supported_maps(11)
new_supported_maps = self.mapid_list
asserts.assert_true(len(old_supported_maps) > len(new_supported_maps), f"Failed to remove map(s)")
asserts.assert_true(len(old_supported_maps) > len(new_supported_maps), "Failed to remove map(s)")

#NOTE the following operations are all part of step 11 - read all these attributes and check the data consistency
# after removing map(s)
Expand Down Expand Up @@ -298,7 +298,7 @@ async def test_TC_SEAR_1_2(self):

await self.read_and_validate_supported_maps(15)
new_supported_maps = self.mapid_list
asserts.assert_true(len(old_supported_maps) < len(new_supported_maps), f"Failed to add map(s)")
asserts.assert_true(len(old_supported_maps) < len(new_supported_maps), "Failed to add map(s)")

#NOTE the following operations are all part of step 15 - read all these attributes and check the data consistency
# after adding map(s)
Expand Down Expand Up @@ -331,7 +331,7 @@ async def test_TC_SEAR_1_2(self):

await self.read_and_validate_supported_areas(19)
new_supported_areas = self.areaid_list
asserts.assert_true(len(old_supported_areas) > len(new_supported_areas), f"Failed to remove area(s)")
asserts.assert_true(len(old_supported_areas) > len(new_supported_areas), "Failed to remove area(s)")

#NOTE the following operations are all part of step 19 - read all these attributes and check the data consistency
# after removing areas(s)
Expand Down Expand Up @@ -363,7 +363,7 @@ async def test_TC_SEAR_1_2(self):

await self.read_and_validate_supported_areas(23)
new_supported_areas = self.areaid_list
asserts.assert_true(len(old_supported_areas) < len(new_supported_areas), f"Failed to add area(s)")
asserts.assert_true(len(old_supported_areas) < len(new_supported_areas), "Failed to add area(s)")

#NOTE the following operations are all part of step 23 - read all these attributes and check the data consistency
# after removing areas(s)
Expand Down
5 changes: 2 additions & 3 deletions src/python_testing/TC_SEAR_1_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from time import sleep

import chip.clusters as Clusters
from chip.clusters.Types import NullValue
from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main
from mobly import asserts

Expand Down Expand Up @@ -109,7 +108,7 @@ async def test_TC_SEAR_1_3(self):
self.write_to_app_pipe('{"Name": "Reset"}')

supported_area_ids = await self.read_supported_areas(2)
asserts.assert_true(len(self.supported_areas) > 0, f"SupportedAreas is empty")
asserts.assert_true(len(self.supported_areas) > 0, "SupportedAreas is empty")
valid_area_id = supported_area_ids[0]
invalid_area_id = 1 + max(supported_area_ids)

Expand All @@ -121,7 +120,7 @@ async def test_TC_SEAR_1_3(self):
await self.send_cmd_select_areas_expect_response(4, [], Clusters.ServiceArea.SelectAreasStatus.kSuccess)

selected_areas = await self.read_selected_areas(5)
asserts.assert_true(len(selected_areas) == 0, f"SelectedAreas should be empty")
asserts.assert_true(len(selected_areas) == 0, "SelectedAreas should be empty")

await self.send_cmd_select_areas_expect_response(6, [invalid_area_id], Clusters.ServiceArea.SelectAreasStatus.kUnsupportedArea)

Expand Down
4 changes: 1 addition & 3 deletions src/python_testing/TC_SEAR_1_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@
# === END CI TEST ARGUMENTS ===

import logging
from time import sleep

import chip.clusters as Clusters
from chip.clusters.Types import NullValue
from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main
from mobly import asserts

Expand Down Expand Up @@ -76,7 +74,7 @@ async def test_TC_SEAR_1_4(self):
cmd_list = await self.read_sear_attribute_expect_success(
endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.AcceptedCommandList)
logging.info("AcceptedCommandList: %s" % (cmd_list))
asserts.assert_true(Clusters.ServiceArea.Commands.SkipArea not in cmd_list, f"SkipArea command should not be implemented if both CurrentArea and Progress are not")
asserts.assert_true(Clusters.ServiceArea.Commands.SkipArea not in cmd_list, "SkipArea command should not be implemented if both CurrentArea and Progress are not")


if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions src/python_testing/TC_SEAR_1_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ async def test_TC_SEAR_1_6(self):
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")

supported_area_ids = await self.read_supported_areas(3)
asserts.assert_true(len(supported_area_ids) > 0, f"SupportedAreas is empty")
asserts.assert_true(len(supported_area_ids) > 0, "SupportedAreas is empty")

selected_areas = await self.read_selected_areas(4)
asserts.assert_true(len(selected_areas) > 0, f"SelectedAreas is empty")
asserts.assert_true(len(selected_areas) > 0, "SelectedAreas is empty")

test_step = "Manually intervene to put the device in the operating state"
self.print_step("5", test_step)
Expand All @@ -133,7 +133,7 @@ async def test_TC_SEAR_1_6(self):
asserts.assert_true(p.status in (Clusters.ServiceArea.OperationalStatusEnum.kPending,
Clusters.ServiceArea.OperationalStatusEnum.kOperating),
f"Progress entry with unexpected Status({p.status})")
asserts.assert_true(p.TotalOperationalTime is NullValue, f"Progress entry with non-null TotalOperationalTime")
asserts.assert_true(p.TotalOperationalTime is NullValue, "Progress entry with non-null TotalOperationalTime")

test_step = "While all entries in Progress show the Pending or Operating status (i.e. \
before any area is skipped or completed), manually intervene to put the device \
Expand Down

0 comments on commit 91c9d5b

Please sign in to comment.