Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update time sync TC_TIMESYNC_2_7 and TC_TIMESYNC_2_8 #27545

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -108,6 +108,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 @@ -106,10 +106,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 @@ -164,19 +163,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