def setup_db(self): self.db_file_path = T.testdb.create_temp_db_file() T.MockedSettings['db_uri'] = T.testdb.get_temp_db_uri(self.db_file_path) with patch.dict(db.Settings, T.MockedSettings): db.init_db() self.insert_checklists() yield db.finalize_db() os.unlink(self.db_file_path)
def setup_db(self): self.db_file_path = T.testdb.create_temp_db_file() T.MockedSettings['db_uri'] = T.testdb.get_temp_db_uri(self.db_file_path) with patch.dict(db.Settings, T.MockedSettings): db.init_db() self.insert_requests() yield db.finalize_db() os.unlink(self.db_file_path)
def main(): usage = 'usage: %prog <oldtag> <newtag>' parser = OptionParser(usage) (_, args) = parser.parse_args() if len(args) == 2: db.init_db() convert_checklist(args[0], args[1]) db.finalize_db() else: parser.error('Incorrect number of arguments')
def cleanup_db(self): db.finalize_db() os.unlink(self.db_file)
def cleanup_database(self): db.finalize_db() os.unlink(self.db_file_path)