Lines Matching refs:dbm
1 """Test script for the dbm.open function based on testdumbdbm.py"""
7 # Skip tests if dbm module doesn't exist.
8 dbm = test.support.import_module('dbm')
11 from dbm import ndbm
18 # Iterates over every database module supported by dbm currently available,
19 # setting dbm to use each in turn, and yielding that module
22 for name in dbm._names:
27 dbm._modules[name] = mod
51 f = dbm.open(_fname, 'n')
66 self.assertRaises(dbm.error, dbm.open, _fname)
69 f = dbm.open(_fname, 'c')
80 f = dbm.open(_fname, 'n')
86 f = dbm.open(_fname, 'c')
93 f = dbm.open(_fname, 'r')
99 f = dbm.open(_fname, 'r')
105 f = dbm.open(_fname, 'r')
120 dbm._defaultmod = self.module
131 if name == 'dbm.dumb':
132 continue # whichdb can't support dbm.dumb
136 self.assertEqual(name, self.dbm.whichdb(_fname))
145 self.assertEqual(name, self.dbm.whichdb(_fname))
153 self.assertIsNone(self.dbm.whichdb(db_file[:-3]))
161 self.d = dbm.open(self.filename, 'c')
163 self.dbm = test.support.import_fresh_module('dbm')
166 self.d = dbm.open(self.filename, 'c')