summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-24 23:51:55 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-24 23:51:55 (GMT)
commita401bbe5f0cadc7b0e26570b96c175cce583661c (patch)
treeec2a687bd7b256b3328e7ebadc22e8f950eb8e34
parentcf2ce36fa28d732cd3ccdfd7a747dfb518d0bfee (diff)
downloadcpython-a401bbe5f0cadc7b0e26570b96c175cce583661c.zip
cpython-a401bbe5f0cadc7b0e26570b96c175cce583661c.tar.gz
cpython-a401bbe5f0cadc7b0e26570b96c175cce583661c.tar.bz2
Add a few mixed-mode (set vs. dict view) comparisons.
-rw-r--r--Lib/test/test_dict.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index 27bda3f..89c127a 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -492,9 +492,13 @@ class DictTest(unittest.TestCase):
def test_dictview_mixed_set_operations(self):
# Just a few for .keys()
+ self.assertTrue({1:1}.keys() == {1})
+ self.assertTrue({1} == {1:1}.keys())
self.assertEquals({1:1}.keys() | {2}, {1, 2})
self.assertEquals({2} | {1:1}.keys(), {1, 2})
# And a few for .items()
+ self.assertTrue({1:1}.items() == {(1,1)})
+ self.assertTrue({(1,1)} == {1:1}.items())
self.assertEquals({1:1}.items() | {2}, {(1,1), 2})
self.assertEquals({2} | {1:1}.items(), {(1,1), 2})