[Python-checkins] CVS: python/dist/src/Lib/test test_gdbm.py,1.2,1.3

Fred L. Drake fdrake@weyr.cnri.reston.va.us
Mon, 7 Feb 2000 12:15:51 -0500 (EST)


Update of /projects/cvsroot/python/dist/src/Lib/test
In directory weyr:/home/fdrake/projects/python/Lib/test

Modified Files:
	test_gdbm.py 
Log Message:

Added test case for accessing gsbm database by key after it's closed;
it should raise gdbm.error.


Index: test_gdbm.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/test/test_gdbm.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** test_gdbm.py	1996/12/20 22:36:49	1.2
--- test_gdbm.py	2000/02/07 17:15:48	1.3
***************
*** 6,10 ****
  import gdbm
  from gdbm import error
! from test_support import verbose
  
  filename= '/tmp/delete_me'
--- 6,10 ----
  import gdbm
  from gdbm import error
! from test_support import verbose, TestFailed
  
  filename= '/tmp/delete_me'
***************
*** 19,22 ****
--- 19,28 ----
  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()