2 """Test script for the bsddb C module
9 from test_support
import verbose
, verify
11 def test(openmethod
, what
):
14 print '\nTesting: ', what
16 fname
= tempfile
.mktemp()
17 f
= openmethod(fname
, 'c')
18 verify(f
.keys() == [])
28 print '%s %s %s' % (f
['a'], f
['b'], f
['c'])
32 print 'key ordering...'
33 f
.set_location(f
.first()[0])
39 print 'Error, last != last!'
44 if not f
.has_key('a'):
45 print 'Error, missing key!'
50 print 'modification...'
51 f
= openmethod(fname
, 'w')
67 types
= [(bsddb
.btopen
, 'BTree'),
68 (bsddb
.hashopen
, 'Hash Table'),
69 # (bsddb.rnopen,'Record Numbers'), 'put' for RECNO for bsddb 1.85
70 # appears broken... at least on
71 # Solaris Intel - rmasse 1/97
75 test(type[0], type[1])