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
c074e9d7
Kaydet (Commit)
c074e9d7
authored
May 26, 2015
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #24286: Forward port dict view abstract base class tests.
üst
395f92d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
test_collections.py
Lib/test/test_collections.py
+7
-0
test_dictviews.py
Lib/test/test_dictviews.py
+22
-0
No files found.
Lib/test/test_collections.py
Dosyayı görüntüle @
c074e9d7
...
@@ -1867,6 +1867,13 @@ class TestOrderedDict(unittest.TestCase):
...
@@ -1867,6 +1867,13 @@ class TestOrderedDict(unittest.TestCase):
od
=
OrderedDict
(
**
d
)
od
=
OrderedDict
(
**
d
)
self
.
assertGreater
(
sys
.
getsizeof
(
od
),
sys
.
getsizeof
(
d
))
self
.
assertGreater
(
sys
.
getsizeof
(
od
),
sys
.
getsizeof
(
d
))
def
test_views
(
self
):
# See http://bugs.python.org/issue24286
s
=
'the quick brown fox jumped over a lazy dog yesterday before dawn'
.
split
()
od
=
OrderedDict
.
fromkeys
(
s
)
self
.
assertEqual
(
od
.
keys
(),
dict
(
od
)
.
keys
())
self
.
assertEqual
(
od
.
items
(),
dict
(
od
)
.
items
())
def
test_override_update
(
self
):
def
test_override_update
(
self
):
# Verify that subclasses can override update() without breaking __init__()
# Verify that subclasses can override update() without breaking __init__()
class
MyOD
(
OrderedDict
):
class
MyOD
(
OrderedDict
):
...
...
Lib/test/test_dictviews.py
Dosyayı görüntüle @
c074e9d7
import
collections
import
unittest
import
unittest
class
DictSetTest
(
unittest
.
TestCase
):
class
DictSetTest
(
unittest
.
TestCase
):
...
@@ -197,6 +198,27 @@ class DictSetTest(unittest.TestCase):
...
@@ -197,6 +198,27 @@ class DictSetTest(unittest.TestCase):
d
[
42
]
=
d
.
values
()
d
[
42
]
=
d
.
values
()
self
.
assertRaises
(
RuntimeError
,
repr
,
d
)
self
.
assertRaises
(
RuntimeError
,
repr
,
d
)
def
test_abc_registry
(
self
):
d
=
dict
(
a
=
1
)
self
.
assertIsInstance
(
d
.
keys
(),
collections
.
KeysView
)
self
.
assertIsInstance
(
d
.
keys
(),
collections
.
MappingView
)
self
.
assertIsInstance
(
d
.
keys
(),
collections
.
Set
)
self
.
assertIsInstance
(
d
.
keys
(),
collections
.
Sized
)
self
.
assertIsInstance
(
d
.
keys
(),
collections
.
Iterable
)
self
.
assertIsInstance
(
d
.
keys
(),
collections
.
Container
)
self
.
assertIsInstance
(
d
.
values
(),
collections
.
ValuesView
)
self
.
assertIsInstance
(
d
.
values
(),
collections
.
MappingView
)
self
.
assertIsInstance
(
d
.
values
(),
collections
.
Sized
)
self
.
assertIsInstance
(
d
.
items
(),
collections
.
ItemsView
)
self
.
assertIsInstance
(
d
.
items
(),
collections
.
MappingView
)
self
.
assertIsInstance
(
d
.
items
(),
collections
.
Set
)
self
.
assertIsInstance
(
d
.
items
(),
collections
.
Sized
)
self
.
assertIsInstance
(
d
.
items
(),
collections
.
Iterable
)
self
.
assertIsInstance
(
d
.
items
(),
collections
.
Container
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
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