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
cc9e5369
Kaydet (Commit)
cc9e5369
authored
Ock 31, 2013
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Added test to ensure localized calendar methods return strings and not bytes.
üst
d72bfe9e
f9fcdb7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
test_calendar.py
Lib/test/test_calendar.py
+13
-3
No files found.
Lib/test/test_calendar.py
Dosyayı görüntüle @
cc9e5369
...
...
@@ -457,11 +457,21 @@ class CalendarTestCase(unittest.TestCase):
# (it is still not thread-safe though)
old_october
=
calendar
.
TextCalendar
()
.
formatmonthname
(
2010
,
10
,
10
)
try
:
calendar
.
LocaleTextCalendar
(
locale
=
''
)
.
formatmonthname
(
2010
,
10
,
10
)
cal
=
calendar
.
LocaleTextCalendar
(
locale
=
''
)
local_weekday
=
cal
.
formatweekday
(
1
,
10
)
local_month
=
cal
.
formatmonthname
(
2010
,
10
,
10
)
except
locale
.
Error
:
# cannot set the system default locale -- skip rest of test
return
calendar
.
LocaleHTMLCalendar
(
locale
=
''
)
.
formatmonthname
(
2010
,
10
)
raise
unittest
.
SkipTest
(
'cannot set the system default locale'
)
self
.
assertIsInstance
(
local_weekday
,
str
)
self
.
assertIsInstance
(
local_month
,
str
)
self
.
assertEqual
(
len
(
local_weekday
),
10
)
self
.
assertGreaterEqual
(
len
(
local_month
),
10
)
cal
=
calendar
.
LocaleHTMLCalendar
(
locale
=
''
)
local_weekday
=
cal
.
formatweekday
(
1
)
local_month
=
cal
.
formatmonthname
(
2010
,
10
)
self
.
assertIsInstance
(
local_weekday
,
str
)
self
.
assertIsInstance
(
local_month
,
str
)
new_october
=
calendar
.
TextCalendar
()
.
formatmonthname
(
2010
,
10
,
10
)
self
.
assertEqual
(
old_october
,
new_october
)
...
...
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