summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-10 04:54:19 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-10 04:54:19 (GMT)
commit83825acd1bd02148c75bd2f4469767d4839196d3 (patch)
treeec99fe681349ecefe2229d2c1fc19e5157e069de /Lib
parentb90c84889eb1d98957dc80c0420df41d6ce32e40 (diff)
downloadcpython-83825acd1bd02148c75bd2f4469767d4839196d3.zip
cpython-83825acd1bd02148c75bd2f4469767d4839196d3.tar.gz
cpython-83825acd1bd02148c75bd2f4469767d4839196d3.tar.bz2
Endow dict views with a proper length method.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_dictviews.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_dictviews.py b/Lib/test/test_dictviews.py
index 15c933f..c0c1da1 100644
--- a/Lib/test/test_dictviews.py
+++ b/Lib/test/test_dictviews.py
@@ -7,16 +7,19 @@ class DictSetTest(unittest.TestCase):
d = {1: 10, "a": "ABC"}
keys = d.KEYS()
self.assertEqual(set(keys), {1, "a"})
+ self.assertEqual(len(keys), 2)
def test_dict_items(self):
d = {1: 10, "a": "ABC"}
items = d.ITEMS()
self.assertEqual(set(items), {(1, 10), ("a", "ABC")})
+ self.assertEqual(len(items), 2)
def test_dict_values(self):
d = {1: 10, "a": "ABC"}
values = d.VALUES()
self.assertEqual(set(values), {10, "ABC"})
+ self.assertEqual(len(values), 2)
def test_main():
test_support.run_unittest(DictSetTest)