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
d87e932f
Kaydet (Commit)
d87e932f
authored
Tem 05, 2010
tarafından
Alexander Belopolsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added two more test cases for datetime
üst
b0f0991c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
test_datetime.py
Lib/test/test_datetime.py
+6
-0
No files found.
Lib/test/test_datetime.py
Dosyayı görüntüle @
d87e932f
...
@@ -881,6 +881,7 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
...
@@ -881,6 +881,7 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
def
test_computations
(
self
):
def
test_computations
(
self
):
a
=
self
.
theclass
(
2002
,
1
,
31
)
a
=
self
.
theclass
(
2002
,
1
,
31
)
b
=
self
.
theclass
(
1956
,
1
,
31
)
b
=
self
.
theclass
(
1956
,
1
,
31
)
c
=
self
.
theclass
(
2001
,
2
,
1
)
diff
=
a
-
b
diff
=
a
-
b
self
.
assertEqual
(
diff
.
days
,
46
*
365
+
len
(
range
(
1956
,
2002
,
4
)))
self
.
assertEqual
(
diff
.
days
,
46
*
365
+
len
(
range
(
1956
,
2002
,
4
)))
...
@@ -906,6 +907,7 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
...
@@ -906,6 +907,7 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
self
.
assertEqual
(
a
-
(
a
+
day
),
-
day
)
self
.
assertEqual
(
a
-
(
a
+
day
),
-
day
)
self
.
assertEqual
(
a
-
(
a
-
week
),
week
)
self
.
assertEqual
(
a
-
(
a
-
week
),
week
)
self
.
assertEqual
(
a
-
(
a
-
day
),
day
)
self
.
assertEqual
(
a
-
(
a
-
day
),
day
)
self
.
assertEqual
(
c
-
(
c
-
day
),
day
)
# Add/sub ints or floats should be illegal
# Add/sub ints or floats should be illegal
for
i
in
1
,
1.0
:
for
i
in
1
,
1.0
:
...
@@ -1347,6 +1349,10 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
...
@@ -1347,6 +1349,10 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
for
month_byte
in
b
'9'
,
b
'
\0
'
,
b
'
\r
'
,
b
'
\xff
'
:
for
month_byte
in
b
'9'
,
b
'
\0
'
,
b
'
\r
'
,
b
'
\xff
'
:
self
.
assertRaises
(
TypeError
,
self
.
theclass
,
self
.
assertRaises
(
TypeError
,
self
.
theclass
,
base
[:
2
]
+
month_byte
+
base
[
3
:])
base
[:
2
]
+
month_byte
+
base
[
3
:])
# Good bytes, but bad tzinfo:
self
.
assertRaises
(
TypeError
,
self
.
theclass
,
bytes
([
1
]
*
len
(
base
)),
'EST'
)
for
ord_byte
in
range
(
1
,
13
):
for
ord_byte
in
range
(
1
,
13
):
# This shouldn't blow up because of the month byte alone. If
# This shouldn't blow up because of the month byte alone. If
# the implementation changes to do more-careful checking, it may
# the implementation changes to do more-careful checking, it may
...
...
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