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

Function test_samoa_transition

tests/test_tz.py:2183–2193  ·  view source on GitHub ↗
(tz_source)

Source from the content-addressed store, hash-verified

2181
2182@pytest.mark.tzfile
2183def test_samoa_transition(tz_source):
2184 # utcoffset() was erroneously returning +14:00 an hour early (GH #812)
2185 APIA = tz.gettz('Pacific/Apia')
2186 assert APIA is not None
2187 dt = datetime(2011, 12, 29, 23, 59, tzinfo=APIA)
2188 assert dt.utcoffset() == timedelta(hours=-10)
2189
2190 # Make sure the transition actually works, too
2191 dt_after = (dt.astimezone(tz.UTC) + timedelta(minutes=1)).astimezone(APIA)
2192 assert dt_after == datetime(2011, 12, 31, tzinfo=APIA)
2193 assert dt_after.utcoffset() == timedelta(hours=14)
2194
2195
2196@unittest.skipUnless(IS_WIN, "Requires Windows")

Callers

nothing calls this directly

Calls 2

gettzMethod · 0.45
utcoffsetMethod · 0.45

Tested by

no test coverage detected