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
2d452ee1
Kaydet (Commit)
2d452ee1
authored
May 26, 2014
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 15246: Improve test coverage for collections.abc.Set. (Contributed by James King).
üst
62f4dad8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
test_collections.py
Lib/test/test_collections.py
+53
-0
ACKS
Misc/ACKS
+1
-0
No files found.
Lib/test/test_collections.py
Dosyayı görüntüle @
2d452ee1
...
@@ -640,6 +640,59 @@ class TestCollectionABCs(ABCTestCase):
...
@@ -640,6 +640,59 @@ class TestCollectionABCs(ABCTestCase):
a
,
b
=
OneTwoThreeSet
(),
OneTwoThreeSet
()
a
,
b
=
OneTwoThreeSet
(),
OneTwoThreeSet
()
self
.
assertTrue
(
hash
(
a
)
==
hash
(
b
))
self
.
assertTrue
(
hash
(
a
)
==
hash
(
b
))
def
test_isdisjoint_Set
(
self
):
class
MySet
(
Set
):
def
__init__
(
self
,
itr
):
self
.
contents
=
itr
def
__contains__
(
self
,
x
):
return
x
in
self
.
contents
def
__iter__
(
self
):
return
iter
(
self
.
contents
)
def
__len__
(
self
):
return
len
([
x
for
x
in
self
.
contents
])
s1
=
MySet
((
1
,
2
,
3
))
s2
=
MySet
((
4
,
5
,
6
))
s3
=
MySet
((
1
,
5
,
6
))
self
.
assertTrue
(
s1
.
isdisjoint
(
s2
))
self
.
assertFalse
(
s1
.
isdisjoint
(
s3
))
def
test_equality_Set
(
self
):
class
MySet
(
Set
):
def
__init__
(
self
,
itr
):
self
.
contents
=
itr
def
__contains__
(
self
,
x
):
return
x
in
self
.
contents
def
__iter__
(
self
):
return
iter
(
self
.
contents
)
def
__len__
(
self
):
return
len
([
x
for
x
in
self
.
contents
])
s1
=
MySet
((
1
,))
s2
=
MySet
((
1
,
2
))
s3
=
MySet
((
3
,
4
))
s4
=
MySet
((
3
,
4
))
self
.
assertTrue
(
s2
>
s1
)
self
.
assertTrue
(
s1
<
s2
)
self
.
assertFalse
(
s2
<=
s1
)
self
.
assertFalse
(
s2
<=
s3
)
self
.
assertFalse
(
s1
>=
s2
)
self
.
assertEqual
(
s3
,
s4
)
self
.
assertNotEqual
(
s2
,
s3
)
def
test_arithmetic_Set
(
self
):
class
MySet
(
Set
):
def
__init__
(
self
,
itr
):
self
.
contents
=
itr
def
__contains__
(
self
,
x
):
return
x
in
self
.
contents
def
__iter__
(
self
):
return
iter
(
self
.
contents
)
def
__len__
(
self
):
return
len
([
x
for
x
in
self
.
contents
])
s1
=
MySet
((
1
,
2
,
3
))
s2
=
MySet
((
3
,
4
,
5
))
s3
=
s1
&
s2
self
.
assertEqual
(
s3
,
MySet
((
3
,)))
def
test_MutableSet
(
self
):
def
test_MutableSet
(
self
):
self
.
assertIsInstance
(
set
(),
MutableSet
)
self
.
assertIsInstance
(
set
(),
MutableSet
)
self
.
assertTrue
(
issubclass
(
set
,
MutableSet
))
self
.
assertTrue
(
issubclass
(
set
,
MutableSet
))
...
...
Misc/ACKS
Dosyayı görüntüle @
2d452ee1
...
@@ -679,6 +679,7 @@ Jason Killen
...
@@ -679,6 +679,7 @@ Jason Killen
Jan Kim
Jan Kim
Taek Joo Kim
Taek Joo Kim
Sam Kimbrel
Sam Kimbrel
James King
W. Trevor King
W. Trevor King
Paul Kippes
Paul Kippes
Steve Kirsch
Steve Kirsch
...
...
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