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
7fa886df
Kaydet (Commit)
7fa886df
authored
Kas 06, 2010
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Prevent ResourceWarnings in test_gettext
üst
37a89334
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
23 deletions
+12
-23
test_gettext.py
Lib/test/test_gettext.py
+12
-23
No files found.
Lib/test/test_gettext.py
Dosyayı görüntüle @
7fa886df
...
...
@@ -64,15 +64,12 @@ class GettextBaseTest(unittest.TestCase):
def
setUp
(
self
):
if
not
os
.
path
.
isdir
(
LOCALEDIR
):
os
.
makedirs
(
LOCALEDIR
)
fp
=
open
(
MOFILE
,
'wb'
)
fp
.
write
(
base64
.
decodebytes
(
GNU_MO_DATA
))
fp
.
close
()
fp
=
open
(
UMOFILE
,
'wb'
)
fp
.
write
(
base64
.
decodebytes
(
UMO_DATA
))
fp
.
close
()
fp
=
open
(
MMOFILE
,
'wb'
)
fp
.
write
(
base64
.
decodebytes
(
MMO_DATA
))
fp
.
close
()
with
open
(
MOFILE
,
'wb'
)
as
fp
:
fp
.
write
(
base64
.
decodebytes
(
GNU_MO_DATA
))
with
open
(
UMOFILE
,
'wb'
)
as
fp
:
fp
.
write
(
base64
.
decodebytes
(
UMO_DATA
))
with
open
(
MMOFILE
,
'wb'
)
as
fp
:
fp
.
write
(
base64
.
decodebytes
(
MMO_DATA
))
self
.
env
=
support
.
EnvironmentVarGuard
()
self
.
env
[
'LANGUAGE'
]
=
'xx'
gettext
.
_translations
.
clear
()
...
...
@@ -135,9 +132,8 @@ trggrkg zrffntr pngnybt yvoenel.''')
def
test_the_alternative_interface
(
self
):
eq
=
self
.
assertEqual
# test the alternative interface
fp
=
open
(
self
.
mofile
,
'rb'
)
t
=
gettext
.
GNUTranslations
(
fp
)
fp
.
close
()
with
open
(
self
.
mofile
,
'rb'
)
as
fp
:
t
=
gettext
.
GNUTranslations
(
fp
)
# Install the translation object
t
.
install
()
eq
(
_
(
'nudge nudge'
),
'wink wink'
)
...
...
@@ -227,9 +223,8 @@ class PluralFormsTestCase(GettextBaseTest):
def
test_plural_forms2
(
self
):
eq
=
self
.
assertEqual
fp
=
open
(
self
.
mofile
,
'rb'
)
t
=
gettext
.
GNUTranslations
(
fp
)
fp
.
close
()
with
open
(
self
.
mofile
,
'rb'
)
as
fp
:
t
=
gettext
.
GNUTranslations
(
fp
)
x
=
t
.
ngettext
(
'There is
%
s file'
,
'There are
%
s files'
,
1
)
eq
(
x
,
'Hay
%
s fichero'
)
x
=
t
.
ngettext
(
'There is
%
s file'
,
'There are
%
s files'
,
2
)
...
...
@@ -299,11 +294,8 @@ class PluralFormsTestCase(GettextBaseTest):
class
UnicodeTranslationsTest
(
GettextBaseTest
):
def
setUp
(
self
):
GettextBaseTest
.
setUp
(
self
)
fp
=
open
(
UMOFILE
,
'rb'
)
try
:
with
open
(
UMOFILE
,
'rb'
)
as
fp
:
self
.
t
=
gettext
.
GNUTranslations
(
fp
)
finally
:
fp
.
close
()
self
.
_
=
self
.
t
.
gettext
def
test_unicode_msgid
(
self
):
...
...
@@ -319,15 +311,12 @@ class UnicodeTranslationsTest(GettextBaseTest):
class
WeirdMetadataTest
(
GettextBaseTest
):
def
setUp
(
self
):
GettextBaseTest
.
setUp
(
self
)
fp
=
open
(
MMOFILE
,
'rb'
)
try
:
with
open
(
MMOFILE
,
'rb'
)
as
fp
:
try
:
self
.
t
=
gettext
.
GNUTranslations
(
fp
)
except
:
self
.
tearDown
()
raise
finally
:
fp
.
close
()
def
test_weird_metadata
(
self
):
info
=
self
.
t
.
info
()
...
...
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