def test_create_database_if_not_exists_does_not_create_database_if_it_exists(self): filesize = 0 if not os.path.exists(self.db_path): open(self.db_path, "w").close() filesize = os.stat(self.db_path).st_size create_database_if_not_exists(self.db_name, [1,2,3], self.db_dir, self.fileext) self.assertEquals(filesize, os.stat(self.db_path).st_size, "File size has changed though nothing should have happened.")
def test_create_database_if_not_exists_creates_database_if_it_does_not_exist(self): if os.path.exists(self.db_path): os.remove(self.db_path) create_database_if_not_exists(self.db_name, [1,2,3], self.db_dir, self.fileext) self.assertTrue(os.path.exists(self.db_path), "Expected file does not exist: " + self.db_path)