Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
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
Exemplo n.º 3
0
 def setUp(self):
     self.path = os.path.join(tempfile.gettempdir(), "tmp_tc_test.tcf")
     self.db = FDB()
     self.db.open(self.path, FDBOWRITER | FDBOCREAT)