Commit 8331f889 authored by Andi Vajda's avatar Andi Vajda
Browse files

fixed tests for icu-72rc

parent e6853b06
......@@ -3,6 +3,7 @@ Version 2.9 ->
- added link to note about building everything from sources
- added wrapper for u_cleanup/u_init sequence as ResourceBundle.resetICU()
- added wrapper for TimeZone.getRegion()
- added support for ICU 72rc
-
Version 2.8.1 -> 2.9
......
......@@ -9,7 +9,7 @@ except ImportError:
from distutils.spawn import find_executable
VERSION = '2.9'
ICU_MAX_MAJOR_VERSION = '71' # max supported major version of ICU
ICU_MAX_MAJOR_VERSION = '72' # max supported major version of ICU
try:
from subprocess import check_output as subprocess_check_output
......
......@@ -71,17 +71,31 @@ class TestDateTimePatternGenerator(TestCase):
'MMMMd', # full name of month + day of the month, i.e., October 25
'hhmm', # 12-hour-cycle format, i.e., 1:32 PM
'jjmm') # preferred hour format for the given locale, i.e., 24-hour-cycle format for fr_FR
locales = (
(Locale('en_US'),
(u'2nd quarter 2016', u'May 2016', u'May 9', u'5:30 PM',
u'5:30 PM')),
(Locale('fr_FR'),
(u'2e trimestre 2016', u'mai 2016', u'9 mai', u'5:30 PM',
u'17:30')),
(Locale('zh_CN'),
(u'2016年第2季度', u'2016年5月', u'5月9日', u'下午5:30',
u'17:30' if ICU_VERSION >= '70.1' else u'下午5:30')),
)
if ICU_VERSION < '72.0':
locales = (
(Locale('en_US'),
(u'2nd quarter 2016', u'May 2016', u'May 9', u'5:30 PM',
u'5:30 PM')),
(Locale('fr_FR'),
(u'2e trimestre 2016', u'mai 2016', u'9 mai', u'5:30 PM',
u'17:30')),
(Locale('zh_CN'),
(u'2016年第2季度', u'2016年5月', u'5月9日', u'下午5:30',
u'17:30' if ICU_VERSION >= '70.1' else u'下午5:30')),
)
else:
locales = (
(Locale('en_US'),
(u'2nd quarter 2016', u'May 2016', u'May 9', u'5:30\u202fPM',
u'5:30\u202fPM')),
(Locale('fr_FR'),
(u'2e trimestre 2016', u'mai 2016', u'9 mai', u'5:30\u202fPM',
u'17:30')),
(Locale('zh_CN'),
(u'2016年第2季度', u'2016年5月', u'5月9日', u'下午5:30',
u'17:30' if ICU_VERSION >= '70.1' else u'下午5:30')),
)
for locale, locale_data in locales:
dtpg = DateTimePatternGenerator.createInstance(locale)
for index, skeleton in enumerate(skeletons):
......@@ -98,7 +112,10 @@ class TestDateTimePatternGenerator(TestCase):
sdf.setTimeZone(self.tz)
pattern = sdf.toPattern()
self.assertEqual(pattern, u'EEEE d MMMM y HH:mm:ss zzzz')
self.assertEqual(sdf.format(self.date), u'lundi 9 mai 2016 17:30:00 heure d’été du Pacifique')
if ICU_VERSION < '72.0':
self.assertEqual(sdf.format(self.date), u'lundi 9 mai 2016 17:30:00 heure d’été du Pacifique')
else:
self.assertEqual(sdf.format(self.date), u'lundi 9 mai 2016 17:30:00 heure d’été du Pacifique nord-américain')
newPattern = dtpg.replaceFieldTypes(pattern, 'vvvv')
sdf.applyPattern(newPattern)
......
Supports Markdown
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