diff options
author | Guido van Rossum <guido@python.org> | 1997-06-02 23:14:00 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-06-02 23:14:00 (GMT) |
commit | ce1fa263e61aefdc6649295abac6c40977604325 (patch) | |
tree | daa96729b24c426d5dd6e0d2fdac66b42d0c0da5 | |
parent | 77e1db3b346411c334a36ccd0d2206ff5c71cc90 (diff) | |
download | cpython-ce1fa263e61aefdc6649295abac6c40977604325.zip cpython-ce1fa263e61aefdc6649295abac6c40977604325.tar.gz cpython-ce1fa263e61aefdc6649295abac6c40977604325.tar.bz2 |
Added tests for dict.clear(), dict.update(), dict.copy().
-rw-r--r-- | Lib/test/test_types.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index 51c76dc..eedf65a 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -180,3 +180,12 @@ d['a'] = 4 if d['c'] <> 3 or d['a'] <> 4: raise TestFailed, 'dict item assignment' del d['b'] if d <> {'a': 4, 'c': 3}: raise TestFailed, 'dict item deletion' +d = {1:1, 2:2, 3:3} +d.clear() +if d != {}: raise TestFailed, 'dict clear' +d.update({1:100}) +d.update({2:20}) +d.update({1:1, 2:2, 3:3}) +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' |