diff options
author | Raymond Hettinger <python@rcn.com> | 2015-05-26 08:47:58 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2015-05-26 08:47:58 (GMT) |
commit | c074e9d765505df971fc89e21d512b40f85e1d6b (patch) | |
tree | ba8b789dc30f2da5aa57bd7659acd43af54d088e /Lib/test/test_collections.py | |
parent | 395f92d471378953bc67fc568982639a00f1b318 (diff) | |
download | cpython-c074e9d765505df971fc89e21d512b40f85e1d6b.zip cpython-c074e9d765505df971fc89e21d512b40f85e1d6b.tar.gz cpython-c074e9d765505df971fc89e21d512b40f85e1d6b.tar.bz2 |
Issue #24286: Forward port dict view abstract base class tests.
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r-- | Lib/test/test_collections.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index ec86466..ac7b9af 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -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): |