Skip to content

Commit 1e3292d

Browse files
jaehs6samgmarcosb
authored andcommitted
Update TC_OCC_3_2.py to fix test step 4d failure. (project-chip#37197)
* Update TC_OCC_3_2.py Fixed 4d test step failure by removing legacy attributes and streamlining attribute subscription test. * Update TC_OCC_3_2.py * Update TC_OCC_3_2.py * Update TC_OCC_3_2.py * Update TC_OCC_3_2.py * Update TC_OCC_3_2.py
1 parent d69f0f3 commit 1e3292d

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

src/python_testing/TC_OCC_3_2.py

+4-24
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
import time
4545

4646
import chip.clusters as Clusters
47-
from chip.testing.matter_testing import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep,
48-
async_test_body, await_sequence_of_reports, default_matter_test_main)
47+
from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body,
48+
await_sequence_of_reports, default_matter_test_main)
4949
from mobly import asserts
5050

5151

@@ -177,30 +177,10 @@ async def test_TC_OCC_3_2(self):
177177

178178
self.step("4c")
179179
await self.write_single_attribute(attributes.HoldTime(hold_time_max))
180-
hold_time_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime)
181-
asserts.assert_equal(hold_time_dut, hold_time_max, "HoldTime did not match written HoldTimeMax")
182180

183181
self.step("4d")
184-
has_no_legacy_features = ((not has_feature_pir) and (not has_feature_ultrasonic) and (not has_feature_contact))
185-
186-
expect_legacy_pir_timing = has_pir_timing_attrib and (has_feature_pir or has_no_legacy_features)
187-
expect_legacy_us_timing = has_ultrasonic_timing_attrib and has_feature_ultrasonic
188-
expect_legacy_phy_timing = has_contact_timing_attrib and has_feature_contact
189-
190-
# Build list of expectations based on attributes present.
191-
all_expected_final_values = [AttributeValue(endpoint_id, attribute=cluster.Attributes.HoldTime, value=hold_time_max)]
192-
if expect_legacy_pir_timing:
193-
all_expected_final_values.append(AttributeValue(
194-
endpoint_id, attribute=cluster.Attributes.PIROccupiedToUnoccupiedDelay, value=hold_time_max))
195-
if expect_legacy_us_timing:
196-
all_expected_final_values.append(AttributeValue(
197-
endpoint_id, attribute=cluster.Attributes.UltrasonicOccupiedToUnoccupiedDelay, value=hold_time_max))
198-
if expect_legacy_phy_timing:
199-
all_expected_final_values.append(AttributeValue(
200-
endpoint_id, attribute=cluster.Attributes.PhysicalContactOccupiedToUnoccupiedDelay, value=hold_time_max))
201-
202-
# Wait for the reports to come.
203-
attrib_listener.await_all_final_values_reported(all_expected_final_values, timeout_sec=post_prompt_settle_delay_seconds)
182+
await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id,
183+
attribute=cluster.Attributes.HoldTime, sequence=[hold_time_max], timeout_sec=post_prompt_settle_delay_seconds)
204184

205185

206186
if __name__ == "__main__":

0 commit comments

Comments
 (0)