def test_01_normalise_PMID(self): identifier_1 = "PMID12345" identifier_2 = "PMID:12345" identifier_1 = pmid.normalise(identifier_1) identifier_2 = pmid.normalise(identifier_2) assert identifier_1 == "12345", identifier_1 assert identifier_2 == "12345", identifier_2
def normalise_pmid(identifier): try: identifier = pmid.normalise(identifier) return identifier except ValueError: return None
def test_02_valid_PMID(self): identifier = "12345" identifier = pmid.normalise(identifier) assert identifier == "12345"