Skip to content

Commit

Permalink
Update TC_OCC_2_1.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jaehs6sam authored Aug 30, 2024
1 parent 81b259d commit 353d918
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/python_testing/TC_OCC_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ async def test_TC_OCC_2_1(self):
if attributes.HoldTimeLimits.attribute_id in attribute_list:
asserts.assert_in(attributes.HoldTime.attribute_id, attribute_list, "HoldTime attribute conformance failed.")
hold_time_limits_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.HoldTimeLimits)
asserts.assert_less_equal(hold_time_limits_dut.holdTimeMin, hold_time_limits_dut.holdTimeMax, "HoldTimeMin is not in valid range")
asserts.assert_less_equal(hold_time_limits_dut.holdTimeMin, hold_time_limits_dut.holdTimeMax,
"HoldTimeMin is not in valid range")
asserts.assert_greater_equal(hold_time_limits_dut.holdTimeMin, 1, "HoldTimeMin minimum value is not 1.")
asserts.assert_greater_equal(hold_time_limits_dut.holdTimeMax, 10, "HoldTimeMax minimum value is not 10.")
asserts.assert_less_equal(hold_time_limits_dut.holdTimeMin, 0xFFFE, "HoldTimeMin is not in valid range.")
asserts.assert_less_equal(hold_time_limits_dut.holdTimeMax, 0xFFFE, "HoldTimeMax is not in valid range.")
asserts.assert_greater_equal(hold_time_limits_dut.holdTimeMax, hold_time_limits_dut.holdTimeMin, "HoldTimeMax is less than HoldTimeMin.")
asserts.assert_greater_equal(hold_time_limits_dut.holdTimeMax, hold_time_limits_dut.holdTimeMin,
"HoldTimeMax is less than HoldTimeMin.")
asserts.assert_less_equal(hold_time_limits_dut.holdTimeDefault,
hold_time_limits_dut.holdTimeMax, "HoldTimeDefault is greater than HoldTimeMax.")
asserts.assert_greater_equal(hold_time_limits_dut.holdTimeDefault,
Expand All @@ -135,12 +137,15 @@ async def test_TC_OCC_2_1(self):

self.step(6)
if attributes.HoldTime.attribute_id in attribute_list:
asserts.assert_in(attributes.HoldTimeLimits.attribute_id, attribute_list, "HoldTimeLimits attribute conformance failed.")
asserts.assert_in(attributes.HoldTimeLimits.attribute_id, attribute_list,
"HoldTimeLimits attribute conformance failed.")
hold_time_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.HoldTime)
hold_time_limits_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.HoldTimeLimits)

asserts.assert_less_equal(hold_time_dut, hold_time_limits_dut.holdTimeMax, "HoldTime attribute is greater than HoldTimeMax.")
asserts.assert_greater_equal(hold_time_dut, hold_time_limits_dut.holdTimeMin, "HoldTime attribute is less than HoldTimeMin.")
asserts.assert_less_equal(hold_time_dut, hold_time_limits_dut.holdTimeMax,
"HoldTime attribute is greater than HoldTimeMax.")
asserts.assert_greater_equal(hold_time_dut, hold_time_limits_dut.holdTimeMin,
"HoldTime attribute is less than HoldTimeMin.")
else:
logging.info("HoldTime not supported. The rest of legacy attribute test can be skipped")
self.skip_all_remaining_steps(7)
Expand Down

0 comments on commit 353d918

Please sign in to comment.