Commit 522095de authored by Alexander Belopolsky's avatar Alexander Belopolsky

Added test for a bug fixed in issue #665194.

parent d7c10ca5
...@@ -3,6 +3,7 @@ from email import utils ...@@ -3,6 +3,7 @@ from email import utils
import test.support import test.support
import time import time
import unittest import unittest
import sys
class DateTimeTests(unittest.TestCase): class DateTimeTests(unittest.TestCase):
...@@ -119,6 +120,17 @@ class LocaltimeTests(unittest.TestCase): ...@@ -119,6 +120,17 @@ class LocaltimeTests(unittest.TestCase):
t2 = utils.localtime(t0.replace(tzinfo=None)) t2 = utils.localtime(t0.replace(tzinfo=None))
self.assertEqual(t1, t2) 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__': if __name__ == '__main__':
unittest.main() unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment