Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
fbf63a7d
Kaydet (Commit)
fbf63a7d
authored
Haz 05, 2009
tarafından
Hirokazu Yamamoto
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix test__locale on windows (Backport of r72365)
üst
4da2fa55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
test__locale.py
Lib/test/test__locale.py
+18
-4
No files found.
Lib/test/test__locale.py
Dosyayı görüntüle @
fbf63a7d
from
test.test_support
import
verbose
,
run_unittest
from
_locale
import
(
setlocale
,
LC_NUMERIC
,
RADIXCHAR
,
THOUSEP
,
nl_langinfo
,
localeconv
,
Error
)
from
_locale
import
(
setlocale
,
LC_NUMERIC
,
localeconv
,
Error
)
try
:
from
_locale
import
(
RADIXCHAR
,
THOUSEP
,
nl_langinfo
)
except
ImportError
:
nl_langinfo
=
None
import
unittest
import
sys
from
platform
import
uname
if
uname
()[
0
]
==
"Darwin"
:
...
...
@@ -20,6 +25,13 @@ candidate_locales = ['es_UY', 'fr_FR', 'fi_FI', 'es_CO', 'pt_PT', 'it_IT',
'eu_ES'
,
'vi_VN'
,
'af_ZA'
,
'nb_NO'
,
'en_DK'
,
'tg_TJ'
,
'en_US'
,
'es_ES.ISO8859-1'
,
'fr_FR.ISO8859-15'
,
'ru_RU.KOI8-R'
,
'ko_KR.eucKR'
]
# Workaround for MSVC6(debug) crash bug
if
"MSC v.1200"
in
sys
.
version
:
def
accept
(
loc
):
a
=
loc
.
split
(
"."
)
return
not
(
len
(
a
)
==
2
and
len
(
a
[
-
1
])
>=
9
)
candidate_locales
=
[
loc
for
loc
in
candidate_locales
if
accept
(
loc
)]
# List known locale values to test against when available.
# Dict formatted as ``<locale> : (<decimal_point>, <thousands_sep>)``. If a
# value is not known, use '' .
...
...
@@ -53,6 +65,7 @@ class _LocaleTests(unittest.TestCase):
calc_type
,
data_type
,
set_locale
,
used_locale
))
@unittest.skipUnless
(
nl_langinfo
,
"nl_langinfo is not available"
)
def
test_lc_numeric_nl_langinfo
(
self
):
# Test nl_langinfo against known values
for
loc
in
candidate_locales
:
...
...
@@ -71,10 +84,11 @@ class _LocaleTests(unittest.TestCase):
setlocale
(
LC_NUMERIC
,
loc
)
except
Error
:
continue
for
li
,
lc
in
(
(
RADIXCHAR
,
"decimal_point"
)
,
(
THOUSEP
,
"thousands_sep"
)
):
for
li
,
lc
in
(
"decimal_point"
,
"thousands_sep"
):
self
.
numeric_tester
(
'localeconv'
,
localeconv
()[
lc
],
lc
,
loc
)
@unittest.skipUnless
(
nl_langinfo
,
"nl_langinfo is not available"
)
def
test_lc_numeric_basic
(
self
):
# Test nl_langinfo against localeconv
for
loc
in
candidate_locales
:
...
...
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