Skip to content

Commit

Permalink
update time sync TC_TIMESYNC_2_7 and TC_TIMESYNC_2_8 (#27545)
Browse files Browse the repository at this point in the history
* include missed set time zone

* expect null when DST expires, missed offset sign, removed unused variables
  • Loading branch information
fessehaeve authored Jul 17, 2023
1 parent 9831f46 commit 98c6716
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_7.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ async def test_TC_TIMESYNC_2_7(self):
if tz_list_size > 1:
th_utc = utc_time_in_matter_epoch()
tz = [tz_struct(offset=3600, validAt=0), tz_struct(offset=7200, validAt=th_utc+1e+7)]
ret = await self.send_set_time_zone_cmd(tz)
asserts.assert_true(ret.DSTOffsetRequired, "DSTOffsetRequired not set to true")

self.print_step(12, "Send SetDSTOffset command")
if tz_list_size > 1:
Expand Down
9 changes: 3 additions & 6 deletions src/python_testing/TC_TIMESYNC_2_8.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ async def test_TC_TIMESYNC_2_8(self):

self.print_step(11, "Read LocalTime")
local = await self.read_ts_attribute_expect_success(local_attr)
compare_time(received=local, offset=timedelta(), tolerance=timedelta(seconds=5))
asserts.assert_equal(local, NullValue, "LocalTime cannot be calculated since DST is empty")

self.print_step(12, "Send SetDSTOffset command")
th_utc = utc_time_in_matter_epoch()
dst = [dst_struct(offset=3600, validStarting=0, validUntil=NullValue)]
await self.send_set_dst_cmd(dst)

Expand Down Expand Up @@ -165,19 +164,17 @@ async def test_TC_TIMESYNC_2_8(self):
self.print_step(24, "Read LocalTime")
if dst_list_size > 1:
local = await self.read_ts_attribute_expect_success(local_attr)
compare_time(received=local, offset=timedelta(), tolerance=timedelta(seconds=5))
asserts.assert_equal(local, NullValue, "LocalTime cannot be calculated since DST is empty")

self.print_step(25, "Send SetDSTOffset command")
th_utc = utc_time_in_matter_epoch()
dst = [dst_struct(offset=3600, validStarting=0, validUntil=NullValue)]
dst = [dst_struct(offset=-3600, validStarting=0, validUntil=NullValue)]
await self.send_set_dst_cmd(dst)

self.print_step(26, "Read LocalTime")
local = await self.read_ts_attribute_expect_success(local_attr)
compare_time(received=local, offset=timedelta(seconds=-3600), tolerance=timedelta(seconds=5))

self.print_step(27, "Send SetDSTOffset command")
th_utc = utc_time_in_matter_epoch()
dst = [dst_struct(offset=0, validStarting=0, validUntil=NullValue)]
await self.send_set_dst_cmd(dst)

Expand Down

0 comments on commit 98c6716

Please sign in to comment.