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
fe92d0b0
Kaydet (Commit)
fe92d0b0
authored
Mar 10, 2008
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Also set LC_CTYPE, to allow localeconv string conversion.
üst
48b98ded
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
test__locale.py
Lib/test/test__locale.py
+7
-3
No files found.
Lib/test/test__locale.py
Dosyayı görüntüle @
fe92d0b0
from
test.test_support
import
verbose
,
TestSkipped
,
run_unittest
from
test.test_support
import
verbose
,
TestSkipped
,
run_unittest
from
_locale
import
(
setlocale
,
LC_NUMERIC
,
RADIXCHAR
,
THOUSEP
,
nl_langinfo
,
from
_locale
import
(
setlocale
,
LC_
ALL
,
LC_CTYPE
,
LC_
NUMERIC
,
RADIXCHAR
,
THOUSEP
,
nl_langinfo
,
localeconv
,
Error
)
localeconv
,
Error
)
import
unittest
import
unittest
from
platform
import
uname
from
platform
import
uname
...
@@ -28,10 +28,10 @@ known_numerics = {'fr_FR' : (',', ''), 'en_US':('.', ',')}
...
@@ -28,10 +28,10 @@ known_numerics = {'fr_FR' : (',', ''), 'en_US':('.', ',')}
class
_LocaleTests
(
unittest
.
TestCase
):
class
_LocaleTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
oldlocale
=
setlocale
(
LC_
NUMERIC
)
self
.
oldlocale
=
setlocale
(
LC_
ALL
)
def
tearDown
(
self
):
def
tearDown
(
self
):
setlocale
(
LC_
NUMERIC
,
self
.
oldlocale
)
setlocale
(
LC_
ALL
,
self
.
oldlocale
)
# Want to know what value was calculated, what it was compared against,
# Want to know what value was calculated, what it was compared against,
# what function was used for the calculation, what type of data was used,
# what function was used for the calculation, what type of data was used,
...
@@ -58,6 +58,7 @@ class _LocaleTests(unittest.TestCase):
...
@@ -58,6 +58,7 @@ class _LocaleTests(unittest.TestCase):
for
loc
in
candidate_locales
:
for
loc
in
candidate_locales
:
try
:
try
:
setlocale
(
LC_NUMERIC
,
loc
)
setlocale
(
LC_NUMERIC
,
loc
)
setlocale
(
LC_CTYPE
,
loc
)
except
Error
:
except
Error
:
continue
continue
for
li
,
lc
in
((
RADIXCHAR
,
"decimal_point"
),
for
li
,
lc
in
((
RADIXCHAR
,
"decimal_point"
),
...
@@ -69,6 +70,7 @@ class _LocaleTests(unittest.TestCase):
...
@@ -69,6 +70,7 @@ class _LocaleTests(unittest.TestCase):
for
loc
in
candidate_locales
:
for
loc
in
candidate_locales
:
try
:
try
:
setlocale
(
LC_NUMERIC
,
loc
)
setlocale
(
LC_NUMERIC
,
loc
)
setlocale
(
LC_CTYPE
,
loc
)
except
Error
:
except
Error
:
continue
continue
for
li
,
lc
in
((
RADIXCHAR
,
"decimal_point"
),
for
li
,
lc
in
((
RADIXCHAR
,
"decimal_point"
),
...
@@ -80,6 +82,7 @@ class _LocaleTests(unittest.TestCase):
...
@@ -80,6 +82,7 @@ class _LocaleTests(unittest.TestCase):
for
loc
in
candidate_locales
:
for
loc
in
candidate_locales
:
try
:
try
:
setlocale
(
LC_NUMERIC
,
loc
)
setlocale
(
LC_NUMERIC
,
loc
)
setlocale
(
LC_CTYPE
,
loc
)
except
Error
:
except
Error
:
continue
continue
for
li
,
lc
in
((
RADIXCHAR
,
"decimal_point"
),
for
li
,
lc
in
((
RADIXCHAR
,
"decimal_point"
),
...
@@ -102,6 +105,7 @@ class _LocaleTests(unittest.TestCase):
...
@@ -102,6 +105,7 @@ class _LocaleTests(unittest.TestCase):
for
loc
in
candidate_locales
:
for
loc
in
candidate_locales
:
try
:
try
:
setlocale
(
LC_NUMERIC
,
loc
)
setlocale
(
LC_NUMERIC
,
loc
)
setlocale
(
LC_CTYPE
,
loc
)
except
Error
:
except
Error
:
continue
continue
...
...
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