Esempio n. 1
0
    def test_db_deletion(self):
        os.remove(self.dbPath)
        self.assertFalse(os.path.exists(self.dbPath))

        Base(".")
        self.assertTrue(os.path.exists(self.dbPath))

        os.remove(self.dbPath)
        os.rmdir(".clsearch")
        self.assertFalse(os.path.exists(self.dbPath))

        Base(".")
        self.assertTrue(os.path.exists(self.dbPath))

        os.remove(self.dbPath)
        os.rmdir(".clsearch")
        self.assertFalse(os.path.exists(self.dbPath))
Esempio n. 2
0
 def test_db_creation(self):
     self.assertRaises(OSError, Base, "/usr")
     Base(".")
     self.assertTrue(os.path.exists(self.dbPath))
Esempio n. 3
0
 def setUp(self):
     self.b = Base()
     self.dbPath = ".clsearch/clsdb.sqlite"