summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dictviews.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-11 06:12:03 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-11 06:12:03 (GMT)
commitcc2b0161257495f859200bce0aea3ed7e646feb3 (patch)
treeba09aba0de6447bef5be59b43fb86d17d760833d /Lib/test/test_dictviews.py
parent4e66dfcdc495218ad5f98b12ad6b4b2b05630ab0 (diff)
downloadcpython-cc2b0161257495f859200bce0aea3ed7e646feb3.zip
cpython-cc2b0161257495f859200bce0aea3ed7e646feb3.tar.gz
cpython-cc2b0161257495f859200bce0aea3ed7e646feb3.tar.bz2
- PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
and .keys(), .items(), .values() return dict views. The dict views aren't fully functional yet; in particular, they can't be compared to sets yet. but they are useful as "iterator wells". There are still 27 failing unit tests; I expect that many of these have fairly trivial fixes, but there are so many, I could use help.
Diffstat (limited to 'Lib/test/test_dictviews.py')
-rw-r--r--Lib/test/test_dictviews.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_dictviews.py b/Lib/test/test_dictviews.py
index 4c436f7..607d182 100644
--- a/Lib/test/test_dictviews.py
+++ b/Lib/test/test_dictviews.py
@@ -4,19 +4,19 @@ from test import test_support
class DictSetTest(unittest.TestCase):
def test_constructors_not_callable(self):
- kt = type({}.KEYS())
+ kt = type({}.keys())
self.assertRaises(TypeError, kt, {})
self.assertRaises(TypeError, kt)
- it = type({}.ITEMS())
+ it = type({}.items())
self.assertRaises(TypeError, it, {})
self.assertRaises(TypeError, it)
- vt = type({}.VALUES())
+ vt = type({}.values())
self.assertRaises(TypeError, vt, {})
self.assertRaises(TypeError, vt)
def test_dict_keys(self):
d = {1: 10, "a": "ABC"}
- keys = d.KEYS()
+ keys = d.keys()
self.assertEqual(set(keys), {1, "a"})
self.assertEqual(len(keys), 2)
self.assert_(1 in keys)
@@ -26,7 +26,7 @@ class DictSetTest(unittest.TestCase):
def test_dict_items(self):
d = {1: 10, "a": "ABC"}
- items = d.ITEMS()
+ items = d.items()
self.assertEqual(set(items), {(1, 10), ("a", "ABC")})
self.assertEqual(len(items), 2)
self.assert_((1, 10) in items)
@@ -39,7 +39,7 @@ class DictSetTest(unittest.TestCase):
def test_dict_values(self):
d = {1: 10, "a": "ABC"}
- values = d.VALUES()
+ values = d.values()
self.assertEqual(set(values), {10, "ABC"})
self.assertEqual(len(values), 2)