def check_issns(row_object): __tracebackhide__ = True row = row_object.row line_str = '{}, line {}: '.format(row_object.file_name, row_object.line_number) for issn_column in [row["issn"], row["issn_print"], row["issn_electronic"], row["issn_l"]]: if issn_column != "NA": if not oat.is_wellformed_ISSN(issn_column): fail(line_str + 'value "' + issn_column + '" is not a ' + 'well-formed ISSN') elif not oat.is_valid_ISSN(issn_column): fail(line_str + 'value "' + issn_column + '" is no valid ' + 'ISSN (check digit mismatch)') issn_l = row["issn_l"] if issn_l != "NA": msg = line_str + "Two entries share a common {} ({}), but the issn_l differs ({} vs {})" issn = row["issn"] if issn != "NA": for reduced_row in issn_dict[issn]: if reduced_row["issn_l"] != issn_l: fail(msg.format("issn", issn, issn_l, reduced_row["issn_l"])) issn_p = row["issn_print"] if issn_p != "NA": for reduced_row in issn_p_dict[issn_p]: if reduced_row["issn_l"] != issn_l: fail(msg.format("issn_p", issn_p, issn_l, reduced_row["issn_l"])) issn_e = row["issn_electronic"] if issn_e != "NA": for reduced_row in issn_e_dict[issn_e]: if reduced_row["issn_l"] != issn_l: fail(msg.format("issn_e", issn_e, issn_l, reduced_row["issn_l"]))
def check_issns(row_object): __tracebackhide__ = True row = row_object.row line_str = '{}, line {}: '.format(row_object.file_name, row_object.line_number) for issn_column in [row["issn"], row["issn_print"], row["issn_electronic"], row["issn_l"]]: if issn_column != "NA": if not oat.is_wellformed_ISSN(issn_column): pytest.fail(line_str + 'value "' + issn_column + '" is not a ' + 'well-formed ISSN') if not oat.is_valid_ISSN(issn_column): pytest.fail(line_str + 'value "' + issn_column + '" is no valid ' + 'ISSN (check digit mismatch)')
def check_issns(row_object): __tracebackhide__ = True row = row_object.row line_str = '{}, line {}: '.format(row_object.file_name, row_object.line_number) for issn_column in [ row["issn"], row["issn_print"], row["issn_electronic"], row["issn_l"] ]: if issn_column != "NA": if not oat.is_wellformed_ISSN(issn_column): pytest.fail(line_str + 'value "' + issn_column + '" is not a ' + 'well-formed ISSN') if not oat.is_valid_ISSN(issn_column): pytest.fail(line_str + 'value "' + issn_column + '" is no valid ' + 'ISSN (check digit mismatch)')