Skip to content

Commit

Permalink
FIX TC_EEVSE_2_3 test fail when run in EST timezone (#36500)
Browse files Browse the repository at this point in the history
* Ensure calculation of target_time_delta in compute_expected_target_time_as_epoch_s is done fully in UTC

* Restyled by autopep8

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
PeterC1965 and restyled-commits authored Nov 15, 2024
1 parent 636abc3 commit be06550
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/python_testing/TC_EEVSE_2_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ def compute_expected_target_time_as_epoch_s(self, minutes_past_midnight):
f"{int(minutes_past_midnight/60)}:{int(minutes_past_midnight%60)}"
f" Expected target_time = {target_time}")

target_time_delta = target_time - \
datetime(2000, 1, 1, 0, 0, 0, 0).astimezone(timezone.utc)
matter_base_time = datetime(2000, 1, 1, 0, 0, 0, 0, tzinfo=timezone.utc)

target_time_delta = target_time - matter_base_time

expected_target_time_epoch_s = int(target_time_delta.total_seconds())
return expected_target_time_epoch_s

Expand Down

0 comments on commit be06550

Please sign in to comment.