test_phd_cds1632177_fix.py 1.72 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# -*- coding: utf-8 -*-
"""PHD

    http://cds.cern.ch/record/1632177

    Measurement of $t\bar{t}$ spin correlation and W polarization with
    the $t\bar{t}$  di-leptonic channel events at ATLAS
    L. Chen
    10 Dec 2013

Corrections are applied to the record.

Note:
    * Only the first author is defined
    * Record submitted is not defined
    * The year is not defined

"""
LE GAC Renaud's avatar
LE GAC Renaud committed
19
import copy
20 21 22
import pytest


23 24
from harvest_tools import CheckAndFix, family_name_fr, format_author_fr
from invenio_tools import load_record
25

26 27 28

@pytest.fixture(scope="module")
def record():
LE GAC Renaud's avatar
LE GAC Renaud committed
29 30 31 32 33
    return load_record('cds.cern.ch', 1632177)

@pytest.fixture(scope="module")
def recordfix(record):
    rec = copy.deepcopy(record)
34

LE GAC Renaud's avatar
LE GAC Renaud committed
35
    svc = CheckAndFix()
36 37
    svc.authors(rec)
    svc.format_authors(rec, format_author_fr)
38
    svc.get_my_authors(rec, family_name_fr)
39 40 41 42 43 44
    svc.submitted(rec)
    svc.year(rec)

    return rec


LE GAC Renaud's avatar
LE GAC Renaud committed
45
def test_authors(record, recordfix):
46
    assert record.authors() == "Chen, Liming"
LE GAC Renaud's avatar
LE GAC Renaud committed
47
    assert recordfix.authors() == "L. Chen"
48 49


LE GAC Renaud's avatar
LE GAC Renaud committed
50 51 52
def test_first_author(record, recordfix):
    assert record.first_author() == "Chen, Liming"
    assert recordfix.first_author() == "L. Chen"
53 54


LE GAC Renaud's avatar
LE GAC Renaud committed
55
def test_these_defense(record, recordfix):
56
    assert record.these_defense() == "10 Dec 2013"
LE GAC Renaud's avatar
LE GAC Renaud committed
57
    assert recordfix.these_defense() == "10 Dec 2013"
58 59


LE GAC Renaud's avatar
LE GAC Renaud committed
60 61 62
def test_these_directors(record, recordfix):
    assert record.these_directors() == "He, Mao, Monnier, Emmanuel, Zhu, Chengguang"
    assert recordfix.these_directors() == "M. He, E. Monnier, C. Zhu"
63 64


LE GAC Renaud's avatar
LE GAC Renaud committed
65 66 67
def test_submitted(record, recordfix):
    assert record.submitted() == []
    assert recordfix.submitted() == ['2013-12-10']
68 69


LE GAC Renaud's avatar
LE GAC Renaud committed
70 71 72
def test_year(record, recordfix):
    assert record.year() == ""
    assert recordfix.year() == "2013"