diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2017-02-04 09:18:42 +0300 |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2017-02-04 09:18:42 +0300 |
commit | 678487eb345f9f9dea3d3818ecad7d39145bdc65 (patch) | |
tree | 35c1a98d1ceadc6b67bf7119031d2a89f27f1cb1 /Lib/test/test_dictviews.py | |
parent | 50a3761c130e9be725bacb5b99d624012c40414a (diff) | |
parent | 19d8ebcbbd396ec603ed03bc79add9b049c31919 (diff) | |
download | cpython-678487eb345f9f9dea3d3818ecad7d39145bdc65.tar.gz |
Issue #29198: Merge from 3.5
Diffstat (limited to 'Lib/test/test_dictviews.py')
-rw-r--r-- | Lib/test/test_dictviews.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Lib/test/test_dictviews.py b/Lib/test/test_dictviews.py index 0c996526d8..49a9e9c007 100644 --- a/Lib/test/test_dictviews.py +++ b/Lib/test/test_dictviews.py @@ -1,3 +1,4 @@ +import collections import copy import pickle import unittest @@ -245,6 +246,27 @@ class DictSetTest(unittest.TestCase): self.assertRaises((TypeError, pickle.PicklingError), pickle.dumps, d.items(), proto) + 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__": unittest.main() |