2 """Test script for the bsddb C module
7 from test_support
import verbose
9 def test(openmethod
, what
):
12 print '\nTesting: ', what
14 fname
= tempfile
.mktemp()
15 f
= openmethod(fname
, 'c')
25 print '%s %s %s' % (f
['a'], f
['b'], f
['c'])
29 print 'key ordering...'
30 f
.set_location(f
.first()[0])
36 print 'Error, last <> last!'
41 if not f
.has_key('a'):
42 print 'Error, missing key!'
47 print 'modification...'
48 f
= openmethod(fname
, 'w')
60 types
= [(bsddb
.btopen
, 'BTree'),
61 (bsddb
.hashopen
, 'Hash Table'),
62 # (bsddb.rnopen,'Record Numbers'), 'put' for RECNO for bsddb 1.85
63 # appears broken... at least on
64 # Solaris Intel - rmasse 1/97
68 test(type[0], type[1])