1 from test
import test_support
8 class DbmTestCase(unittest
.TestCase
):
11 self
.filename
= test_support
.TESTFN
12 self
.d
= dbm
.open(self
.filename
, 'c')
16 for suffix
in ['', '.pag', '.dir', '.db']:
17 test_support
.unlink(self
.filename
+ suffix
)
20 self
.d
= dbm
.open(self
.filename
, 'c')
21 self
.assert_(self
.d
.keys() == [])
23 self
.d
['12345678910'] = '019237410982340912840198242'
25 self
.assert_(self
.d
.has_key('a'))
29 for mode
in ['r', 'rw', 'w', 'n']:
31 self
.d
= dbm
.open(self
.filename
, mode
)
37 test_support
.run_unittest(DbmTestCase
)
39 if __name__
== '__main__':