Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
main
pyicu
Commits
0736bc26
Commit
0736bc26
authored
Oct 01, 2021
by
Andi Vajda
Browse files
fixed test failure in test_DateTimeParserGenerator.py with version 70.1rc
parent
a35ab31a
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
0736bc26
Version 2.7.4 ->
----------------------
- fixed test failure in test_DateTimeParserGenerator.py with version 70.1rc
-
Version 2.7.3 -> 2.7.4
----------------------
- added wrappers for UWordBreak and BreakIterator.getRuleStatusVec()
- added wrappers for MessagePattern (Roman Kalukiewicz)
- added wrapper for Collator::getKeywordValuesForLocale
- added wrapper for Collator::getKeywordValuesForLocale
()
Version 2.7.2 -> 2.7.3
----------------------
...
...
test/test_DateTimeParserGenerator.py
View file @
0736bc26
...
...
@@ -71,18 +71,24 @@ 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
'下午5:30'
)),)
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'
)),
)
for
locale
,
locale_data
in
locales
:
dtpg
=
DateTimePatternGenerator
.
createInstance
(
locale
)
for
index
,
skeleton
in
enumerate
(
skeletons
):
pattern
=
dtpg
.
getBestPattern
(
skeleton
)
sdf
=
SimpleDateFormat
(
pattern
,
locale
)
sdf
.
setTimeZone
(
self
.
tz
)
print
(
locale
,
index
,
skeleton
,
locale_data
[
index
])
self
.
assertEqual
(
sdf
.
format
(
self
.
date
),
locale_data
[
index
])
def
testReplaceFieldType
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment