Add comprehensive tests for get_local_tz timezone detection #2467
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds comprehensive test coverage for the
get_local_tzfunction in the time server, ensuring proper handling of timezone detection across different platforms.Server Details
Motivation and Context
While reviewing PR #1272 (which addresses bug #489 about Windows timezone issues), I noticed that the main branch already has a robust fix using the
tzlocallibrary. However, there were no tests covering theget_local_tzfunction to ensure it properly handles various edge cases.This PR adds tests to verify:
tzlocal.get_localzone_name()How Has This Been Tested?
get_local_tz)Breaking Changes
No
Types of changes
Checklist
Additional context
This PR complements the existing solution in main that uses
tzlocalfor robust timezone detection. The tests ensure that the current implementation correctly handles edge cases that were identified in issue #489 (Windows "Pacific Standard Time" timezone) and related issues #612 and #786.The main branch's solution using
tzlocal.get_localzone_name()is superior to the approach in PR #1272 as it's a well-maintained library specifically designed for cross-platform timezone detection.