| 2181 | |
| 2182 | @pytest.mark.tzfile |
| 2183 | def 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") |