Skip to content

Commit 41d5607

Browse files
restyled-commitsaustina-csa
authored andcommitted
Restyled by autopep8
1 parent 353ca21 commit 41d5607

File tree

1 file changed

+39
-30
lines changed

1 file changed

+39
-30
lines changed

src/python_testing/TC_IDM_2_2.py

+39-30
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main
2222
from mobly import asserts
2323

24+
2425
class TC_IDM_2_2(MatterBaseTest):
2526

2627
ROOT_NODE_ENDPOINT_ID = 0
@@ -37,9 +38,9 @@ def get_typed_attribute_path(attribute, ep=ROOT_NODE_ENDPOINT_ID):
3738
@async_test_body
3839
async def test_TC_IDM_2_2(self):
3940
# Test Setup
40-
cluster_rev_attr = Clusters.BasicInformation.Attributes.ClusterRevision # Global attribute
41+
cluster_rev_attr = Clusters.BasicInformation.Attributes.ClusterRevision # Global attribute
4142
cluster_rev_attr_path = [(cluster_rev_attr)]
42-
node_label_attr = Clusters.BasicInformation.Attributes.NodeLabel # Borrowed from TC_IDM_4_2
43+
node_label_attr = Clusters.BasicInformation.Attributes.NodeLabel # Borrowed from TC_IDM_4_2
4344
node_label_attr_path = [(0, node_label_attr)]
4445
node_label_attr_all = Clusters.BasicInformation
4546
node_label_attr_all_path = [(0, node_label_attr_all)]
@@ -57,82 +58,89 @@ async def test_TC_IDM_2_2(self):
5758
# AttributePath = [[Endpoint = Specific Endpoint, Cluster = Specific ClusterID, Attribute = Specific Attribute]]
5859
# On receipt of this message, DUT should send a report data action with the attribute value to the DUT
5960

60-
read_request_1 = await self.default_controller.ReadAttribute(self.dut_node_id, node_label_attr_path) # [(0, Clusters.BasicInformation.Attributes.NodeLabel)]
61+
# [(0, Clusters.BasicInformation.Attributes.NodeLabel)]
62+
read_request_1 = await self.default_controller.ReadAttribute(self.dut_node_id, node_label_attr_path)
6163
attributes = read_request_1[0]
6264
basic_information = attributes[basic_info_attr]
6365

6466
asserts.assert_in(node_label_attr, basic_information, "NodeLabel not in BasicInformation")
6567
asserts.assert_in(data_version_attr, basic_information, "DataVersion not in BasicInformation")
6668

67-
### TH sends the Read Request Message to the DUT to read all attributes on a given cluster and Endpoint
68-
### AttributePath = [[Endpoint = Specific Endpoint, Cluster = Specific ClusterID]]
69-
### On receipt of this message, DUT should send a report data action with the attribute value to the DUT.
69+
# TH sends the Read Request Message to the DUT to read all attributes on a given cluster and Endpoint
70+
# AttributePath = [[Endpoint = Specific Endpoint, Cluster = Specific ClusterID]]
71+
# On receipt of this message, DUT should send a report data action with the attribute value to the DUT.
7072

7173
self.print_step(2, "Send Request Message to read all attributes on a given cluster and endpoint")
7274
asserts.assert_in(node_label_attr, basic_information, "AttributeList not in attributes")
73-
read_request_2 = await self.default_controller.ReadAttribute(self.dut_node_id, node_label_attr_all_path) # [(0, Clusters.BasicInformation)]
75+
# [(0, Clusters.BasicInformation)]
76+
read_request_2 = await self.default_controller.ReadAttribute(self.dut_node_id, node_label_attr_all_path)
7477
attributes = read_request_2[0]
7578
basic_information = attributes[basic_info_attr]
7679
asserts.assert_in(node_label_attr, basic_information, "NodeLabel not in BasicInformation")
7780
asserts.assert_in(data_version_attr, basic_information, "DataVersion not in BasicInformation")
7881
# The output from this command gets many more values from basic_info_attr compared to the first test -- get attribute list, expand test if needed
7982
asserts.assert_in(attribute_list_attr, basic_information, "AttributeList not in BasicInformation")
8083

81-
### TH sends the Read Request Message to the DUT to read an attribute from a cluster at all Endpoints
82-
### AttributePath = [[Cluster = Specific ClusterID, Attribute = Specific Attribute]]
83-
### On receipt of this message, DUT should send a report data action with the attribute value from all the Endpoints to the DUT.
84+
# TH sends the Read Request Message to the DUT to read an attribute from a cluster at all Endpoints
85+
# AttributePath = [[Cluster = Specific ClusterID, Attribute = Specific Attribute]]
86+
# On receipt of this message, DUT should send a report data action with the attribute value from all the Endpoints to the DUT.
8487
self.print_step(3, "Send Request Message to read one attribute on a given cluster at all endpoints")
85-
read_request_3 = await self.default_controller.ReadAttribute(self.dut_node_id, [node_label_attr]) # [Clusters.BasicInformation.Attributes.NodeLabel]
88+
# [Clusters.BasicInformation.Attributes.NodeLabel]
89+
read_request_3 = await self.default_controller.ReadAttribute(self.dut_node_id, [node_label_attr])
8690
attributes = read_request_3[0]
8791
asserts.assert_in(node_label_attr, basic_information, "NodeLabel not in BasicInformation")
8892

89-
### TH sends the Read Request Message to the DUT to read a global attribute from all clusters at that Endpoint
90-
### AttributePath = [[Endpoint = Specific Endpoint, Attribute = Specific Global Attribute]]
91-
### On receipt of this message, DUT should send a report data action with the attribute value from all the clusters to the DUT.
93+
# TH sends the Read Request Message to the DUT to read a global attribute from all clusters at that Endpoint
94+
# AttributePath = [[Endpoint = Specific Endpoint, Attribute = Specific Global Attribute]]
95+
# On receipt of this message, DUT should send a report data action with the attribute value from all the clusters to the DUT.
9296
self.print_step(4, "Send Request Message to read one global attribute from all clusters at that endpoint")
9397
# The output from this command gets many more values from unit_testing_attr compared to the some other tests
94-
read_request_4 = await self.default_controller.ReadAttribute(self.dut_node_id, cluster_rev_attr_path) # [(Clusters.BasicInformation.Attributes.ClusterRevision)]
98+
# [(Clusters.BasicInformation.Attributes.ClusterRevision)]
99+
read_request_4 = await self.default_controller.ReadAttribute(self.dut_node_id, cluster_rev_attr_path)
95100
attributes = read_request_4[0]
96101
basic_information = attributes[basic_info_attr]
97102
asserts.assert_true(basic_information[cluster_revision_attr], 3)
98103

99-
### TH sends the Read Request Message to the DUT to read all attributes from all clusters on all Endpoints
104+
# TH sends the Read Request Message to the DUT to read all attributes from all clusters on all Endpoints
100105
### AttributePath = [[]]
101-
### On receipt of this message, DUT should send a report data action with the attribute value from all the clusters to the DUT.
106+
# On receipt of this message, DUT should send a report data action with the attribute value from all the clusters to the DUT.
102107
self.print_step(5, "Send Request Message to read all attributes from all clusters on all endpoints")
103-
read_request_5 = await self.default_controller.ReadAttribute(self.dut_node_id, [()]) # This returns a dataclass key of 1, unlike 0 for the earlier ones
108+
# This returns a dataclass key of 1, unlike 0 for the earlier ones
109+
read_request_5 = await self.default_controller.ReadAttribute(self.dut_node_id, [()])
104110
attributes = read_request_5[1]
105111
unit_testing = attributes[unit_testing_attr]
106112

107113
# asserts.assert_in(node_label_attr, unit_testing, "NodeLabel not in UnitTesting")
108114
asserts.assert_in(data_version_attr, unit_testing, "DataVersion not in UnitTesting")
109-
### TH sends the Read Request Message to the DUT to read a global attribute from all clusters at all Endpoints
110-
### AttributePath = [[Attribute = Specific Global Attribute]]
111-
### On receipt of this message, DUT should send a report data action with the attribute value from all the clusters to the DUT.
115+
# TH sends the Read Request Message to the DUT to read a global attribute from all clusters at all Endpoints
116+
# AttributePath = [[Attribute = Specific Global Attribute]]
117+
# On receipt of this message, DUT should send a report data action with the attribute value from all the clusters to the DUT.
112118
self.print_step(6, "Send Request Message to read one global attribute from all clusters on all endpoints")
113-
read_request_6 = await self.default_controller.ReadAttribute(self.dut_node_id, [cluster_rev_attr]) # Clusters.BasicInformation.Attributes.ClusterRevision
119+
# Clusters.BasicInformation.Attributes.ClusterRevision
120+
read_request_6 = await self.default_controller.ReadAttribute(self.dut_node_id, [cluster_rev_attr])
114121

115122
attributes = read_request_6[0]
116123
basic_information = attributes[basic_info_attr]
117124
# asserts.assert_in(node_label_attr, basic_information, "NodeLabel not in BasicInformation")
118125
asserts.assert_in(data_version_attr, basic_information, "DataVersion not in BasicInformation")
119126
asserts.assert_true(basic_information[cluster_revision_attr], 3)
120127

121-
### TH sends the Read Request Message to the DUT to read all attributes from a cluster at all Endpoints
122-
### AttributePath = [[Cluster = Specific ClusterID]]
123-
### On receipt of this message, DUT should send a report data action with the attribute value from all the Endpoints to the DUT.
128+
# TH sends the Read Request Message to the DUT to read all attributes from a cluster at all Endpoints
129+
# AttributePath = [[Cluster = Specific ClusterID]]
130+
# On receipt of this message, DUT should send a report data action with the attribute value from all the Endpoints to the DUT.
124131
self.print_step(7, "Send Request Message to read all attributes from one cluster at all endpoints")
125-
read_request_7 = await self.default_controller.ReadAttribute(self.dut_node_id, [node_label_attr_all]) # [Clusters.BasicInformation]
132+
# [Clusters.BasicInformation]
133+
read_request_7 = await self.default_controller.ReadAttribute(self.dut_node_id, [node_label_attr_all])
126134
attributes = read_request_7[0]
127135
basic_information = attributes[basic_info_attr]
128136
asserts.assert_in(node_label_attr, basic_information, "NodeLabel not in BasicInformation")
129137
asserts.assert_in(data_version_attr, basic_information, "DataVersion not in BasicInformation")
130138
# The output from this command gets many more values from basic_info_attr compared to the first test -- get attribute list, expand test if needed
131139
asserts.assert_in(attribute_list_attr, basic_information, "AttributeList not in BasicInformation")
132140

133-
### TH sends the Read Request Message to the DUT to read all attributes from all clusters at one Endpoint
134-
### AttributePath = [[Endpoint = Specific Endpoint]]
135-
### On receipt of this message, DUT should send a report data action with the attribute value from all the Endpoints to the DUT.
141+
# TH sends the Read Request Message to the DUT to read all attributes from all clusters at one Endpoint
142+
# AttributePath = [[Endpoint = Specific Endpoint]]
143+
# On receipt of this message, DUT should send a report data action with the attribute value from all the Endpoints to the DUT.
136144
self.print_step(8, "Send Request Message to read all attributes from all clusters at one endpoint")
137145
read_request_8 = await self.default_controller.ReadAttribute(self.dut_node_id, [0])
138146
attributes = read_request_8[0]
@@ -142,5 +150,6 @@ async def test_TC_IDM_2_2(self):
142150
asserts.assert_in(data_version_attr, network_diagnostics, "DataVersion not in ThreadNetworkDiagnostics")
143151
asserts.assert_in(attribute_list_attr, basic_information, "AttributeList not in BasicInformation")
144152

153+
145154
if __name__ == "__main__":
146-
default_matter_test_main()
155+
default_matter_test_main()

0 commit comments

Comments
 (0)