def checkClean(self): conf = Configuration.load(self.codeface_conf, self.project_conf) dbm = DBManager(conf) project_id = dbm.getProjectID(conf["project"], self.tagging) dbm.doExecCommit("DELETE FROM project WHERE id={}".format(project_id)) for table in pid_tables: res = dbm.doExec("SELECT * FROM {table} WHERE projectId={pid}". format(table=table, pid=project_id)) self.assertEqual(res, 0, msg="Table '{}' still dirty!". format(table)) for table in other_tables: res = dbm.doExec("SELECT * FROM {table}".format(table=table)) self.assertEqual(res, 0, msg="Table '{}' still dirty!".format(table))
def setup_with_p(self, p): path = self.p.directory self.gitdir = dirname(path) self.resdir = pathjoin(path, ".git", "results") self.mldir = pathjoin(path, ".git") self.project_conf = self.p.codeface_conf self.no_report = False self.loglevel = "devinfo" self.logfile = pathjoin(path, ".git", "log") self.recreate = False # This config_file is added in the codeface test command handler self.codeface_conf = self.config_file conf = Configuration.load(self.codeface_conf, self.project_conf) dbm = DBManager(conf) for table in pid_tables + other_tables: dbm.doExecCommit("DELETE FROM {}".format(table))
def clear_tables(self): conf = Configuration.load(self.codeface_conf, self.project_conf) dbm = DBManager(conf) for table in self.result_tables: dbm.doExecCommit("DELETE FROM {}".format(table))