From 1f924d21d3f8a7fba3409544abca53a814de15f6 Mon Sep 17 00:00:00 2001 From: Alexander Belopolsky Date: Wed, 22 Aug 2012 22:06:37 -0400 Subject: Added test for a bug fixed in issue #665194. --- Lib/test/test_email/test_utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Lib/test/test_email/test_utils.py b/Lib/test/test_email/test_utils.py index 7d0267e..0ade770 100644 --- a/Lib/test/test_email/test_utils.py +++ b/Lib/test/test_email/test_utils.py @@ -3,6 +3,7 @@ from email import utils import test.support import time import unittest +import sys class DateTimeTests(unittest.TestCase): @@ -119,6 +120,17 @@ class LocaltimeTests(unittest.TestCase): t2 = utils.localtime(t0.replace(tzinfo=None)) self.assertEqual(t1, t2) + # XXX: Need a more robust test for Olson's tzdata + @unittest.skipIf(sys.platform.startswith('win'), + "Windows does not use Olson's TZ database") + @test.support.run_with_tz('Europe/Kiev') + def test_variable_tzname(self): + t0 = datetime.datetime(1984, 1, 1, tzinfo=datetime.timezone.utc) + t1 = utils.localtime(t0) + self.assertEqual(t1.tzname(), 'MSK') + t0 = datetime.datetime(1994, 1, 1, tzinfo=datetime.timezone.utc) + t1 = utils.localtime(t0) + self.assertEqual(t1.tzname(), 'EET') if __name__ == '__main__': unittest.main() -- cgit v0.12