test_marc.py 1.89 KB
Newer Older
1
"""test_marc
2 3

"""
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
from invenio_tools import (is_conference,
                           is_institute,
                           is_thesis,
                           load_record,
                           Record,
                           RecordConf,
                           RecordInst,
                           RecordPubli,
                           RecordThesis)


def test_conference_cds():
    record = load_record("cds.cern.ch", 1411352)
    assert is_conference(record) == True
    assert is_institute(record) == False
    assert is_thesis(record) == False
    assert isinstance(record, RecordConf)

def test_conference_inspirehep():
    record = load_record("inspirehep.net", 1276938)
    assert is_conference(record) == True
    assert is_institute(record) == False
    assert is_thesis(record) == False
    assert isinstance(record, RecordConf)

def test_institute():
    """CPPM"""
    record = load_record("inspirehep.net", 902989)
    assert is_conference(record) == False
    assert is_institute(record) == True
    assert is_thesis(record) == False
    assert isinstance(record, RecordInst)


def test_publi_cds():
    """Precision luminosity measurements at LHCb"""
    record = load_record("cds.cern.ch", 1951625)
    assert is_conference(record) == False
    assert is_institute(record) == False
    assert is_thesis(record) == False
    assert isinstance(record, RecordPubli)


def test_publi_inspirehep():
    """Precision luminosity measurements at LHCb"""
    record = load_record("inspirehep.net", 1319638)
    assert is_conference(record) == False
    assert is_institute(record) == False
    assert is_thesis(record) == False
    assert isinstance(record, RecordPubli)


def test_thesis_cds():
    record = load_record("cds.cern.ch", 1632177)
    assert is_conference(record) == False
    assert is_institute(record) == False
    assert is_thesis(record) == True
    assert isinstance(record, RecordThesis)