mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #24286: Forward port dict view abstract base class tests.
This commit is contained in:
parent
395f92d471
commit
c074e9d765
2 changed files with 29 additions and 0 deletions
|
@ -1867,6 +1867,13 @@ class TestOrderedDict(unittest.TestCase):
|
|||
od = OrderedDict(**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):
|
||||
# Verify that subclasses can override update() without breaking __init__()
|
||||
class MyOD(OrderedDict):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue