diff options
author | Paul Ganssle <paul@ganssle.io> | 2018-09-02 10:08:37 -0400 |
---|---|---|
committer | Paul Ganssle <paul@ganssle.io> | 2018-09-02 14:32:31 -0400 |
commit | 9b8744e7a8fc10d00345c6339197599657fcac29 (patch) | |
tree | 006b81b352b1e7b00d251d01612f965699972484 /dateutil | |
parent | a5d860d370a8486fdbcd338c244dc5f583beba5f (diff) | |
download | dateutil-9b8744e7a8fc10d00345c6339197599657fcac29.tar.gz |
Add failing test for bug with Samoan offset change
Diffstat (limited to 'dateutil')
-rw-r--r-- | dateutil/test/test_tz.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/dateutil/test/test_tz.py b/dateutil/test/test_tz.py index 84416dd..fb0cd44 100644 --- a/dateutil/test/test_tz.py +++ b/dateutil/test/test_tz.py @@ -1950,11 +1950,6 @@ class TZTest(unittest.TestCase): tzc = tz.tzfile(fileobj) self.assertEqual(repr(tzc), 'tzfile(' + repr('foo') + ')') - - - - - def testLeapCountDecodesProperly(self): # This timezone has leapcnt, and failed to decode until # Eugene Oden notified about the issue. @@ -2036,6 +2031,20 @@ def test_sub_minute_rounding_tzfile(): assert datetime(1900, 1, 1, 0, 0, tzinfo=tzc).utcoffset() == offset +@pytest.mark.tzfile +@pytest.mark.xfail +def test_samoa_transition(): + # utcoffset() is erroneously returning +14:00 an hour early (GH #812) + APIA = tz.gettz('Pacific/Apia') + dt = datetime(2011, 12, 29, 23, 59, tzinfo=APIA) + assert dt.utcoffset() == timedelta(hours=-10) + + # Make sure the transition actually works, too + dt_after = (dt.astimezone(tz.UTC) + timedelta(minutes=1)).astimezone(APIA) + assert dt_after == datetime(2011, 12, 31, tzinfo=APIA) + assert dt_after.utcoffset() == timedelta(hours=14) + + @unittest.skipUnless(IS_WIN, "Requires Windows") class TzWinTest(unittest.TestCase, TzWinFoldMixin): def setUp(self): |