summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dbm.py
blob: be24c66fe4eb81550eb08aac7ee450f7d087919e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /usr/bin/env python
"""Test script for the dbm module
   Roger E. Masse
"""
import dbm
from dbm import error
filename= '/tmp/delete_me'

d = dbm.open(filename, 'c')
d['a'] = 'b'
d['12345678910'] = '019237410982340912840198242'
d.keys()
d.has_key('a')
d.close()
d = dbm.open(filename, 'r')
d.close()
d = dbm.open(filename, 'rw')
d.close()
d = dbm.open(filename, 'w')
d.close()
d = dbm.open(filename, 'n')
d.close()

try:
    import os
    os.unlink(filename + '.dir')
    os.unlink(filename + '.pag')
except:
    pass