Skip to content

Commit 7b7a129

Browse files
jaehs6samtcarmelveilleuxleorozendaal
authored andcommitted
Update TC_OCC_2_1.py (project-chip#35324)
* Update TC_OCC_2_1.py Updating TC 2.1 to address issue (project-chip#35318) * Update TC_OCC_2_1.py * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: Leo Rozendaal <leo.rozendaal@signify.com> --------- Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com> Co-authored-by: Leo Rozendaal <leo.rozendaal@signify.com>
1 parent d1c5cac commit 7b7a129

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/python_testing/TC_OCC_2_1.py

+14-8
Original file line numberDiff line numberDiff line change
@@ -121,25 +121,31 @@ async def test_TC_OCC_2_1(self):
121121
hold_time_limits_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.HoldTimeLimits)
122122
asserts.assert_less_equal(hold_time_limits_dut.holdTimeMin, hold_time_limits_dut.holdTimeMax,
123123
"HoldTimeMin is not in valid range")
124-
asserts.assert_greater_equal(hold_time_limits_dut.holdTimeMin, 0, "HoldTimeMin is not in valid range")
125-
asserts.assert_less_equal(hold_time_limits_dut.holdTimeMax, 0xFFFE, "HoldTimeMin is not in valid range")
126-
asserts.assert_greater_equal(hold_time_limits_dut.holdTimeMax,
127-
hold_time_limits_dut.holdTimeMin, "HoldTimeMin is not in valid range")
124+
asserts.assert_greater_equal(hold_time_limits_dut.holdTimeMin, 1, "HoldTimeMin is less than 1.")
125+
asserts.assert_greater_equal(hold_time_limits_dut.holdTimeMax, 10, "HoldTimeMax is less than 10.")
126+
asserts.assert_less_equal(hold_time_limits_dut.holdTimeMin, 0xFFFE, "HoldTimeMin is not in valid range.")
127+
asserts.assert_less_equal(hold_time_limits_dut.holdTimeMax, 0xFFFE, "HoldTimeMax is not in valid range.")
128+
asserts.assert_greater_equal(hold_time_limits_dut.holdTimeMax, hold_time_limits_dut.holdTimeMin,
129+
"HoldTimeMax is less than HoldTimeMin.")
128130
asserts.assert_less_equal(hold_time_limits_dut.holdTimeDefault,
129-
hold_time_limits_dut.holdTimeMax, "HoldTimeMin is not in valid range")
131+
hold_time_limits_dut.holdTimeMax, "HoldTimeDefault is greater than HoldTimeMax.")
130132
asserts.assert_greater_equal(hold_time_limits_dut.holdTimeDefault,
131-
hold_time_limits_dut.holdTimeMin, "HoldTimeMin is not in valid range")
133+
hold_time_limits_dut.holdTimeMin, "HoldTimeDefault is less than HoldTimeMin.")
132134
else:
133135
logging.info("HoldTimeLimits not supported. Test step skipped")
134136
self.mark_current_step_skipped()
135137

136138
self.step(6)
137139
if attributes.HoldTime.attribute_id in attribute_list:
140+
asserts.assert_in(attributes.HoldTimeLimits.attribute_id, attribute_list,
141+
"HoldTimeLimits attribute conformance failed.")
138142
hold_time_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.HoldTime)
139143
hold_time_limits_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.HoldTimeLimits)
140144

141-
asserts.assert_less_equal(hold_time_dut, hold_time_limits_dut.holdTimeMax, "HoldTime attribute is out of range")
142-
asserts.assert_greater_equal(hold_time_dut, hold_time_limits_dut.holdTimeMin, "HoldTime attribute is out of range")
145+
asserts.assert_less_equal(hold_time_dut, hold_time_limits_dut.holdTimeMax,
146+
"HoldTime attribute is greater than HoldTimeMax.")
147+
asserts.assert_greater_equal(hold_time_dut, hold_time_limits_dut.holdTimeMin,
148+
"HoldTime attribute is less than HoldTimeMin.")
143149
else:
144150
logging.info("HoldTime not supported. The rest of legacy attribute test can be skipped")
145151
self.skip_all_remaining_steps(7)

0 commit comments

Comments
 (0)