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
f242aebb
Kaydet (Commit)
f242aebb
authored
Kas 16, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #9051: Added tests for pickling and copying the timezone objects.
üst
a4d33b34
e28209f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
datetimetester.py
Lib/test/datetimetester.py
+28
-1
No files found.
Lib/test/datetimetester.py
Dosyayı görüntüle @
f242aebb
...
...
@@ -3,6 +3,7 @@
See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
"""
import
copy
import
decimal
import
sys
import
pickle
...
...
@@ -235,7 +236,6 @@ class TestTimeZone(unittest.TestCase):
tzrep
=
repr
(
tz
)
self
.
assertEqual
(
tz
,
eval
(
tzrep
))
def
test_class_members
(
self
):
limit
=
timedelta
(
hours
=
23
,
minutes
=
59
)
self
.
assertEqual
(
timezone
.
utc
.
utcoffset
(
None
),
ZERO
)
...
...
@@ -322,6 +322,33 @@ class TestTimeZone(unittest.TestCase):
self
.
assertEqual
(
tz
.
dst
(
t
),
t
.
replace
(
tzinfo
=
tz
)
.
dst
())
def
test_pickle
(
self
):
for
tz
in
self
.
ACDT
,
self
.
EST
,
timezone
.
min
,
timezone
.
max
:
for
pickler
,
unpickler
,
proto
in
pickle_choices
:
tz_copy
=
unpickler
.
loads
(
pickler
.
dumps
(
tz
,
proto
))
self
.
assertEqual
(
tz_copy
,
tz
)
tz
=
timezone
.
utc
for
pickler
,
unpickler
,
proto
in
pickle_choices
:
tz_copy
=
unpickler
.
loads
(
pickler
.
dumps
(
tz
,
proto
))
self
.
assertIs
(
tz_copy
,
tz
)
def
test_copy
(
self
):
for
tz
in
self
.
ACDT
,
self
.
EST
,
timezone
.
min
,
timezone
.
max
:
tz_copy
=
copy
.
copy
(
tz
)
self
.
assertEqual
(
tz_copy
,
tz
)
tz
=
timezone
.
utc
tz_copy
=
copy
.
copy
(
tz
)
self
.
assertIs
(
tz_copy
,
tz
)
def
test_deepcopy
(
self
):
for
tz
in
self
.
ACDT
,
self
.
EST
,
timezone
.
min
,
timezone
.
max
:
tz_copy
=
copy
.
deepcopy
(
tz
)
self
.
assertEqual
(
tz_copy
,
tz
)
tz
=
timezone
.
utc
tz_copy
=
copy
.
deepcopy
(
tz
)
self
.
assertIs
(
tz_copy
,
tz
)
#############################################################################
# Base class for testing a particular aspect of timedelta, time, date and
# datetime comparisons.
...
...
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