Update the TimestampStrings zone info handling

time_zone is the string version of the time zone data
time_zone_zi is the ZoneInfo object of above
This commit is contained in:
Clemens Schwaighofer
2025-09-25 15:53:26 +09:00
parent 2690a285d9
commit 7c5af588c7
3 changed files with 10 additions and 8 deletions

View File

@@ -144,8 +144,8 @@ class TestTimestampStrings:
ts = TimestampStrings(time_zone=custom_tz_obj)
# The time_zone should be the ZoneInfo object itself
assert ts.time_zone is custom_tz_obj
assert isinstance(ts.time_zone, ZoneInfo)
assert ts.time_zone_zi is custom_tz_obj
assert isinstance(ts.time_zone_zi, ZoneInfo)
def test_zoneinfo_object_vs_string_equivalence(self):
"""Test that ZoneInfo object and string produce equivalent results"""
@@ -167,7 +167,7 @@ class TestTimestampStrings:
# The time_zone attributes will be different types but represent the same timezone
assert str(ts_string.time_zone) == 'Europe/Paris'
assert isinstance(ts_zoneinfo.time_zone, ZoneInfo)
assert isinstance(ts_zoneinfo.time_zone_zi, ZoneInfo)
def test_edge_case_midnight(self):
"""Test timestamp formatting at midnight"""