MCPcopy Create free account
hub / github.com/dateutil/dateutil / test_sub_minute_offset

Function test_sub_minute_offset

tests/test_tzfile.py:2541–2549  ·  view source on GitHub ↗

Sub-minute offsets retain their exact value.

()

Source from the content-addressed store, hash-verified

2539
2540
2541def test_sub_minute_offset():
2542 """Sub-minute offsets retain their exact value."""
2543 zone = tz.tzfile(_sub_minute_zone())
2544 dt = datetime(1900, 1, 1, tzinfo=zone)
2545
2546 assert dt.utcoffset() == timedelta(seconds=-968)
2547
2548 assert dt.tzname() == "LMT"
2549 assert datetime(2000, 1, 1, tzinfo=zone).utcoffset() == ZERO
2550
2551
2552def test_sub_minute_offset_round_trip():

Callers

nothing calls this directly

Calls 3

_sub_minute_zoneFunction · 0.85
utcoffsetMethod · 0.45
tznameMethod · 0.45

Tested by

no test coverage detected