def test_open(self): for e, t in tdbm._db_exts.items(): path = os.path.join(tempfile.gettempdir(), "tmp_tdbm_test{0}".format(e)) db = tdbm.open(path, "c") self.assertTrue(isinstance(db, t)) db.close() os.remove(path)
def test_whichdb(self): for e, t in tdbm._db_exts.items(): path = os.path.join(tempfile.gettempdir(), "tmp_tdbm_test{0}".format(e)) db = tdbm.open(path, "c") db.close() self.assertEqual(tdbm.whichdb(path), t) os.remove(path)
def _open(self, flag): self.db = tdbm.open(self.path, flag)
def test_open_default(self): path = os.path.join(tempfile.gettempdir(), "tmp_tdbm_test.db") db = tdbm.open(path, "c") self.assertTrue(isinstance(db, tdbm.TCHDB)) db.close() os.remove(path)