def check_record(ticket, record): # pylint: disable-msg=W0613 """ Requirements to create ticket: * Record must have 980__$aCORE * Needs to be younger than 6 months in the system * Must be an arXiv paper Returns True if all above is true. @param ticket: a ticket object as created by BibCatalogTicket() containing the subject, body and queue to create a ticket in. @type ticket: record object of BibCatalogTicket. @param record: a recstruct object as created by bibrecord.create_record() @type record: record object of BibRecord. @return: True if ticket should be created. @rtype: bool """ # It has to be a CORE record if not record_in_collection(record, "CORE"): return False # Finally it has to be an arXiv record if not record_in_collection(record, "ARXIV"): return False # We are arXiv! return True
def check_record(ticket, record): # pylint: disable-msg=W0613 """ Checks to see if we should create a ticket. @param ticket: a ticket object as created by BibCatalogTicket() containing the subject, body and queue to create a ticket in. @type ticket: record object of BibCatalogTicket. @param record: a recstruct object as created by bibrecord.create_record() @type record: record object of BibRecord. @return: returns True if record is a 'ARTICLE' record. @rtype: bool """ return record_in_collection(record, "ARTICLE")
def test_record_in_collection(self): """Tests function bibcatalog_utils.record_in_collection""" self.assertFalse(record_in_collection(self.record, "THESIS")) self.assertTrue(record_in_collection(self.record, "picture"))