summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2012-08-23 02:06:37 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2012-08-23 02:06:37 (GMT)
commit1f924d21d3f8a7fba3409544abca53a814de15f6 (patch)
tree520bccf198dfe5b5562403e4315a31a9103c58ec /Lib
parent097a1208bc932f72491c77e24669ac3c0ed14bf6 (diff)
downloadcpython-1f924d21d3f8a7fba3409544abca53a814de15f6.zip
cpython-1f924d21d3f8a7fba3409544abca53a814de15f6.tar.gz
cpython-1f924d21d3f8a7fba3409544abca53a814de15f6.tar.bz2
Added test for a bug fixed in issue #665194.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_email/test_utils.py12
1 files changed, 12 insertions, 0 deletions
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()