diff options
author | Roger E. Masse <rmasse@newcnri.cnri.reston.va.us> | 1996-12-17 19:54:27 (GMT) |
---|---|---|
committer | Roger E. Masse <rmasse@newcnri.cnri.reston.va.us> | 1996-12-17 19:54:27 (GMT) |
commit | 62a017c0920e4569659fcf2f92e3f9bdd905fb17 (patch) | |
tree | 33035486730ec507ad0d2d4c3d3efeef9f6fb046 | |
parent | 4ca4b075167745bb2c1743e6ef7de9f78f793490 (diff) | |
download | cpython-62a017c0920e4569659fcf2f92e3f9bdd905fb17.zip cpython-62a017c0920e4569659fcf2f92e3f9bdd905fb17.tar.gz cpython-62a017c0920e4569659fcf2f92e3f9bdd905fb17.tar.bz2 |
Test script for the GNU dbm module (gdbm)
-rwxr-xr-x | Lib/test/test_gdbm.py | 35 | ||||
-rw-r--r-- | Lib/test/testall.py | 1 |
2 files changed, 36 insertions, 0 deletions
diff --git a/Lib/test/test_gdbm.py b/Lib/test/test_gdbm.py new file mode 100755 index 0000000..d0d705a --- /dev/null +++ b/Lib/test/test_gdbm.py @@ -0,0 +1,35 @@ +#! /usr/bin/env python +"""Test script for the gdbm module + Roger E. Masse +""" +verbose = 0 +if __name__ == '__main__': + verbose = 1 + +import gdbm +from gdbm import error +filename= '/tmp/delete_me' + +g = gdbm.open(filename, 'c') +g['a'] = 'b' +g['12345678910'] = '019237410982340912840198242' +a = g.keys() +if verbose: + print 'Test gdbm file keys: ', a + +g.has_key('a') +g.close() +g = gdbm.open(filename, 'r') +g.close() +g = gdbm.open(filename, 'rw') +g.close() +g = gdbm.open(filename, 'w') +g.close() +g = gdbm.open(filename, 'n') +g.close() + +try: + import os + os.unlink(filename) +except: + pass diff --git a/Lib/test/testall.py b/Lib/test/testall.py index fa7c5ea7..62b16a4 100644 --- a/Lib/test/testall.py +++ b/Lib/test/testall.py @@ -27,6 +27,7 @@ tests = ['test_grammar', 'test_thread', 'test_xdr', 'test_fcntl', + 'test_gdbm', ] if __name__ == '__main__': |