def test_copy(self): self.db[1] = b"a" self.db[2] = b"b" path = os.path.join(tempfile.gettempdir(), "tmp_tc_test2.tcf") self.db.copy(path) db = FDB() db.open(path, FDBOREADER) self.assertEqual(len(self.db), len(db)) self.assertEqual(self.db.size, db.size) db.close() os.remove(path)
class FDBTest(unittest.TestCase): def setUp(self): self.path = os.path.join(tempfile.gettempdir(), "tmp_tc_test.tcf") self.db = FDB() self.db.open(self.path, FDBOWRITER | FDBOCREAT) def tearDown(self): self.db.close() os.remove(self.path) self.db = None
def setUp(self): self.path = os.path.join(tempfile.gettempdir(), "tmp_tc_test.tcf") self.db = FDB() self.db.open(self.path, FDBOWRITER | FDBOCREAT)