summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-10-20 20:10:43 (GMT)
committerGuido van Rossum <guido@python.org>1997-10-20 20:10:43 (GMT)
commitfb5cef116087058944f209cda38b1f5c56c30d23 (patch)
tree2c9a949e153ed71bf0c37b140746e9bde414e82a /Lib/test
parent6fcfa72c633269c1cf265e801ed5af30aff1a730 (diff)
downloadcpython-fb5cef116087058944f209cda38b1f5c56c30d23.zip
cpython-fb5cef116087058944f209cda38b1f5c56c30d23.tar.gz
cpython-fb5cef116087058944f209cda38b1f5c56c30d23.tar.bz2
Added separate tests for {}.get().
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_types.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index c3d59cb..7cca131 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -190,6 +190,9 @@ if d != {1:1, 2:2, 3:3}: raise TestFailed, 'dict update'
if d.copy() != {1:1, 2:2, 3:3}: raise TestFailed, 'dict copy'
if {}.copy() != {}: raise TestFailed, 'empty dict copy'
# dict.get()
+d = {}
+if d.get('c') != None: raise TestFailed, 'missing {} get, no 2nd arg'
+if d.get('c', 3) != 3: raise TestFailed, 'missing {} get, w/ 2nd arg'
d = {'a' : 1, 'b' : 2}
if d.get('c') != None: raise TestFailed, 'missing dict get, no 2nd arg'
if d.get('c', 3) != 3: raise TestFailed, 'missing dict get, w/ 2nd arg'