Skip to content

Commit

Permalink
Restyle
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille committed Dec 20, 2022
1 parent 28ff0ca commit 163fb1c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/python_testing/TC_ACE_1_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@
# run with
# --int-arg PIXIT.ACE.ENDPOINT:<endpoint> PIXIT.ACE.APPDEVTYPE:<device_type_id>
# --string-arg PIXIT.ACE.APPCLUSTER:<cluster_name> PIXIT.ACE.APPATTRIBUTE:<attribute_name>


def str_to_cluster(str):
return getattr(sys.modules["chip.clusters.Objects"], str)


def str_to_attribute(cluster, str):
return getattr(cluster.Attributes, str)


class TC_ACE_1_4(MatterBaseTest):

async def write_acl(self, acl):
Expand All @@ -41,12 +45,12 @@ async def write_acl(self, acl):
asserts.assert_equal(result[0].Status, Status.Success, "ACL write failed")
print(result)

async def read_descriptor_expect_success(self, endpoint:int) -> None:
async def read_descriptor_expect_success(self, endpoint: int) -> None:
cluster = Clusters.Objects.Descriptor
attribute = Clusters.Descriptor.Attributes.DeviceTypeList
await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute)

async def read_descriptor_expect_unsupported_access(self, endpoint:int) -> None:
async def read_descriptor_expect_unsupported_access(self, endpoint: int) -> None:
cluster = Clusters.Objects.Descriptor
attribute = Clusters.Descriptor.Attributes.DeviceTypeList
await self.read_single_attribute_expect_error(endpoint=endpoint, cluster=cluster, attribute=attribute, error=Status.UnsupportedAccess)
Expand All @@ -60,7 +64,7 @@ async def read_appcluster_expect_unsupported_access(self) -> None:
async def read_wildcard_endpoint(self, attribute: object) -> object:
return await self.default_controller.ReadAttribute(self.dut_node_id, [(attribute)])

def check_read_success(self, results: object, endpoint:int, cluster:object, attribute:object) -> None:
def check_read_success(self, results: object, endpoint: int, cluster: object, attribute: object) -> None:
err_msg = "Results not returned for ep {}".format(str(endpoint))
asserts.assert_true(endpoint in results, err_msg)
err_msg = "Results not returned for cluster {} on ep {}".format(str(cluster), str(endpoint))
Expand Down Expand Up @@ -156,7 +160,6 @@ async def test_TC_ACE_1_3(self):
self.print_step(13, "TH1 reads PIXIT.ACE.APPENDPOINT PIXIT.ACE.APPCLUSTER - expect SUCCESS")
await self.read_appcluster_expect_success()


self.print_step(14, "TH1 writes ACL descriptor view on PIXIT.ACE.APPENDPOINT")
descriptor_appendpoint_view = Clusters.AccessControl.Structs.AccessControlEntry(
privilege=Clusters.AccessControl.Enums.Privilege.kView,
Expand Down Expand Up @@ -214,7 +217,6 @@ async def test_TC_ACE_1_3(self):
self.print_step(25, "TH1 reads PIXIT.ACE.APPENDPOINT PIXIT.ACE.APPCLUSTER - expect SUCCESS")
await self.read_appcluster_expect_success()


self.print_step(26, "TH1 writes ACL rootnode device type view on all endpoints")
rootnode_view = Clusters.AccessControl.Structs.AccessControlEntry(
privilege=Clusters.AccessControl.Enums.Privilege.kView,
Expand All @@ -234,7 +236,6 @@ async def test_TC_ACE_1_3(self):
self.print_step(29, "TH1 reads PIXIT.ACE.APPENDPOINT PIXIT.ACE.APPCLUSTER - expect UNSUPPORTED_ACCESS")
await self.read_appcluster_expect_unsupported_access()


self.print_step(30, "TH1 writes ACL PIXIT.ACE.APPDEVTYPE view on all endpoints")
appdevtype_view = Clusters.AccessControl.Structs.AccessControlEntry(
privilege=Clusters.AccessControl.Enums.Privilege.kView,
Expand All @@ -254,7 +255,6 @@ async def test_TC_ACE_1_3(self):
self.print_step(33, "TH1 reads PIXIT.ACE.APPENDPOINT PIXIT.ACE.APPCLUSTER - expect SUCCESS")
await self.read_appcluster_expect_success()


self.print_step(34, "TH1 writes ACL descriptor cluster on appdevtype on all endpoints")
descriptor_appdevtype_view = Clusters.AccessControl.Structs.AccessControlEntry(
privilege=Clusters.AccessControl.Enums.Privilege.kView,
Expand Down Expand Up @@ -293,7 +293,6 @@ async def test_TC_ACE_1_3(self):
self.print_step(41, "TH1 reads PIXIT.ACE.APPENDPOINT PIXIT.ACE.APPCLUSTER - expect SUCCESS")
await self.read_appcluster_expect_success()


self.print_step(42, "TH1 writes ACL multi-target view")
multitarget_view = Clusters.AccessControl.Structs.AccessControlEntry(
privilege=Clusters.AccessControl.Enums.Privilege.kView,
Expand Down Expand Up @@ -342,4 +341,4 @@ async def test_TC_ACE_1_3(self):


if __name__ == "__main__":
default_matter_test_main()
default_matter_test_main()

0 comments on commit 163fb1c

Please sign in to comment.