# -*- coding: utf-8 -*- """Record non conformities From time to time some record keys are duplicated. Protection are add in the record method to correct them """ from invenio_tools import load_record def test_protection_authors_as_list(): """[u'Zuniga, J.', u'(the A.N.T.ARES. Collaboration)']""" record = load_record('inspirehep.net', 1386663) authors = record.authors_as_list() assert len(authors) == 140 assert authors[129] == u"Zuniga, J." def test_protection_oai(): """['oai:cds.cern.ch:1513204', 'oai:cds.cern.ch:1512766']""" record = load_record('cds.cern.ch', 1513204) assert record.oai() == 'oai:cds.cern.ch:1513204' assert record.host() == "cds.cern.ch" def test_protection_paper_year(): record = load_record('cds.cern.ch', 1951625) assert record["773"]["y"] == ["2014", "2014"] assert record.paper_year() == "2014" def test_protection_paper_url(): record = load_record('cds.cern.ch', 2014733) assert record.paper_url() == "http://arxiv.org/pdf/1505.01654" def test_protection_year(): record = load_record('inspirehep.net', 1319638) assert record["260"]["c"] == "2014-12-05" assert record.year() == "2014" def test_protection_repord_number(): record = load_record('inspirehep.net', 1221481) assert record.report_number() == "" record = load_record('cds.cern.ch', 1955425) assert record.report_number() == "ATLAS-EXOT-2014-01-003, CERN-PH-EP-2014-229"