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
838e76af
Kaydet (Commit)
838e76af
authored
Şub 25, 2003
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Test suite for the plistlib module.
üst
04087b56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
test_plistlib.py
Lib/test/test_plistlib.py
+59
-0
No files found.
Lib/test/test_plistlib.py
0 → 100644
Dosyayı görüntüle @
838e76af
# Copyright (C) 2003 Python Software Foundation
import
unittest
import
plistlib
import
os
from
test
import
test_support
class
TestPlistlib
(
unittest
.
TestCase
):
def
tearDown
(
self
):
try
:
os
.
unlink
(
test_support
.
TESTFN
)
except
:
pass
def
_create
(
self
):
pl
=
plistlib
.
Plist
(
aString
=
"Doodah"
,
aList
=
[
"A"
,
"B"
,
12
,
32.1
,
[
1
,
2
,
3
]],
aFloat
=
0.1
,
anInt
=
728
,
aDict
=
plistlib
.
Dict
(
anotherString
=
"<hello & hi there!>"
,
aUnicodeValue
=
u'M
\xe4
ssig, Ma
\xdf
'
,
aTrueValue
=
True
,
aFalseValue
=
False
,
),
someData
=
plistlib
.
Data
(
"<binary gunk>"
),
someMoreData
=
plistlib
.
Data
(
"<lots of binary gunk>"
*
10
),
)
pl
[
'anotherInt'
]
=
42
try
:
from
xml.utils.iso8601
import
parse
import
time
except
ImportError
:
pass
else
:
pl
[
'aDate'
]
=
plistlib
.
Date
(
time
.
mktime
(
time
.
gmtime
()))
return
pl
def
test_create
(
self
):
pl
=
self
.
_create
()
self
.
assertEqual
(
pl
[
"aString"
],
"Doodah"
)
self
.
assertEqual
(
pl
[
"aDict"
][
"aFalseValue"
],
False
)
def
test_io
(
self
):
pl
=
self
.
_create
()
pl
.
write
(
test_support
.
TESTFN
)
pl2
=
plistlib
.
Plist
.
fromFile
(
test_support
.
TESTFN
)
self
.
assertEqual
(
dict
(
pl
),
dict
(
pl2
))
def
test_main
():
test_support
.
run_unittest
(
TestPlistlib
)
if
__name__
==
'__main__'
:
test_main
()
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