From c074e9d765505df971fc89e21d512b40f85e1d6b Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 26 May 2015 01:47:58 -0700 Subject: Issue #24286: Forward port dict view abstract base class tests. --- Lib/test/test_collections.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Lib/test/test_collections.py') diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index ec86466779..ac7b9af2f4 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): -- cgit v1.2.1