summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-02-07 17:15:48 (GMT)
committerFred Drake <fdrake@acm.org>2000-02-07 17:15:48 (GMT)
commita710d6e20cebc0d8a2aa6e8df5c37d9263d86d9b (patch)
treebbf099dda3d164f0d40aa3a48932237226f7d169
parentef6ceb62bde8ff9ffc09df7686c3d4a50548a425 (diff)
downloadcpython-a710d6e20cebc0d8a2aa6e8df5c37d9263d86d9b.zip
cpython-a710d6e20cebc0d8a2aa6e8df5c37d9263d86d9b.tar.gz
cpython-a710d6e20cebc0d8a2aa6e8df5c37d9263d86d9b.tar.bz2
Added test case for accessing gsbm database by key after it's closed;
it should raise gdbm.error.
-rwxr-xr-xLib/test/test_gdbm.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_gdbm.py b/Lib/test/test_gdbm.py
index 22db6aa..030218e 100755
--- a/Lib/test/test_gdbm.py
+++ b/Lib/test/test_gdbm.py
@@ -5,7 +5,7 @@
import gdbm
from gdbm import error
-from test_support import verbose
+from test_support import verbose, TestFailed
filename= '/tmp/delete_me'
@@ -18,6 +18,12 @@ if verbose:
g.has_key('a')
g.close()
+try:
+ g['a']
+except error:
+ pass
+else:
+ raise TestFailed, "expected gdbm.error accessing closed database"
g = gdbm.open(filename, 'r')
g.close()
g = gdbm.open(filename, 'rw')