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
eae05de9
Kaydet (Commit)
eae05de9
authored
Tem 09, 2004
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* fix the print test
* add more __init__ tests
üst
a435c53e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
test_set.py
Lib/test/test_set.py
+14
-0
No files found.
Lib/test/test_set.py
Dosyayı görüntüle @
eae05de9
...
...
@@ -4,6 +4,7 @@ from weakref import proxy
import
operator
import
copy
import
pickle
import
os
class
PassThru
(
Exception
):
pass
...
...
@@ -201,6 +202,8 @@ class TestSet(TestJointOps):
self
.
assertEqual
(
s
,
set
(
self
.
word
))
s
.
__init__
(
self
.
otherword
)
self
.
assertEqual
(
s
,
set
(
self
.
otherword
))
self
.
assertRaises
(
TypeError
,
s
.
__init__
,
s
,
2
);
self
.
assertRaises
(
TypeError
,
s
.
__init__
,
1
);
def
test_constructor_identity
(
self
):
s
=
self
.
thetype
(
range
(
3
))
...
...
@@ -436,6 +439,17 @@ class TestBasicOps(unittest.TestCase):
if
self
.
repr
is
not
None
:
self
.
assertEqual
(
repr
(
self
.
set
),
self
.
repr
)
def
test_print
(
self
):
try
:
fo
=
open
(
test_support
.
TESTFN
,
"wb"
)
print
>>
fo
,
self
.
set
,
fo
.
close
()
fo
=
open
(
test_support
.
TESTFN
,
"rb"
)
self
.
assertEqual
(
fo
.
read
(),
repr
(
self
.
set
))
finally
:
fo
.
close
()
os
.
remove
(
test_support
.
TESTFN
)
def
test_length
(
self
):
self
.
assertEqual
(
len
(
self
.
set
),
self
.
length
)
...
...
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