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
bc561982
Kaydet (Commit)
bc561982
authored
May 22, 2001
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Convert time module tests to PyUnit.
üst
5b021848
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
25 deletions
+37
-25
test_time.py
Lib/test/test_time.py
+37
-25
No files found.
Lib/test/test_time.py
Dosyayı görüntüle @
bc561982
import
test_support
import
time
import
time
import
unittest
time
.
altzone
time
.
clock
()
t
=
time
.
time
()
time
.
asctime
(
time
.
gmtime
(
t
))
if
time
.
ctime
(
t
)
!=
time
.
asctime
(
time
.
localtime
(
t
)):
print
'time.ctime(t) != time.asctime(time.localtime(t))'
time
.
daylight
class
TimeTestCase
(
unittest
.
TestCase
):
if
long
(
time
.
mktime
(
time
.
localtime
(
t
)))
!=
long
(
t
):
print
'time.mktime(time.localtime(t)) != t'
time
.
sleep
(
1.2
)
def
setUp
(
self
):
tt
=
time
.
gmtime
(
t
)
self
.
t
=
time
.
time
()
for
directive
in
(
'a'
,
'A'
,
'b'
,
'B'
,
'c'
,
'd'
,
'H'
,
'I'
,
def
test_data_attributes
(
self
):
time
.
altzone
time
.
daylight
time
.
timezone
time
.
tzname
def
test_clock
(
self
):
time
.
clock
()
def
test_conversions
(
self
):
self
.
assert_
(
time
.
ctime
(
self
.
t
)
==
time
.
asctime
(
time
.
localtime
(
self
.
t
)))
self
.
assert_
(
long
(
time
.
mktime
(
time
.
localtime
(
self
.
t
)))
==
long
(
self
.
t
))
def
test_sleep
(
self
):
time
.
sleep
(
1.2
)
def
test_strftime
(
self
):
tt
=
time
.
gmtime
(
self
.
t
)
for
directive
in
(
'a'
,
'A'
,
'b'
,
'B'
,
'c'
,
'd'
,
'H'
,
'I'
,
'j'
,
'm'
,
'M'
,
'p'
,
'S'
,
'j'
,
'm'
,
'M'
,
'p'
,
'S'
,
'U'
,
'w'
,
'W'
,
'x'
,
'X'
,
'y'
,
'Y'
,
'Z'
,
'
%
'
):
'U'
,
'w'
,
'W'
,
'x'
,
'X'
,
'y'
,
'Y'
,
'Z'
,
'
%
'
):
format
=
'
%
'
+
directive
format
=
'
%
'
+
directive
try
:
try
:
time
.
strftime
(
format
,
tt
)
time
.
strftime
(
format
,
tt
)
except
ValueError
:
except
ValueError
:
print
'conversion specifier:'
,
format
,
' failed.'
self
.
fail
(
'conversion specifier:
%
r failed.'
%
format
)
time
.
timezone
time
.
tzname
# expected errors
def
test_asctime
(
self
):
try
:
time
.
asctime
(
time
.
gmtime
(
self
.
t
))
time
.
asctime
(
0
)
self
.
assertRaises
(
TypeError
,
time
.
asctime
,
0
)
except
TypeError
:
pass
try
:
def
test_mktime
(
self
):
time
.
mktime
((
999999
,
999999
,
999999
,
999999
,
self
.
assertRaises
(
OverflowError
,
time
.
mktime
,
(
999999
,
999999
,
999999
,
999999
,
999999
,
999999
,
999999
,
999999
,
999999
,
999999
,
999999
,
999999
,
999999
))
999999
))
except
OverflowError
:
pass
test_support
.
run_unittest
(
TimeTestCase
)
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