# -*- coding: utf-8 -*- """PROCEEDING http://cds.cern.ch/record/1411352 Prospects for CP violation in B0s --> J/psiphi from first LHCb data O. Leroy, Symposium on Prospects in the Physics of Discrete Symmetries, Rome, Italy, 6 - 11 Dec 2010 J. Phys.: Conf. Ser. 335 (2011) 012042 No correction are applied to the record. Allow to test the brute force decoding with its mistakes. Note: * Only the first authors is defined * The submitted date is 05 Jan 2012 * conference date 6 - 11 Dec 2010 """ import copy import pytest from harvest_tools import CheckAndFix, family_name_fr, format_author_fr from invenio_tools import load_record @pytest.fixture(scope="module") def record(): rec = load_record('cds.cern.ch', 1411352) return rec @pytest.fixture(scope="module") def recordfix(record): rec = copy.deepcopy(record) svc = CheckAndFix() svc.authors(rec) svc.country(rec) svc.conference_date(rec, "cds.cern.ch") svc.format_authors(rec, format_author_fr) svc.format_editor(rec) svc.get_my_authors(rec, family_name_fr) svc.submitted(rec) svc.year(rec) return rec def test_authors(record, recordfix): assert record.authors() == "Leroy, Olivier" assert recordfix.authors() == "O. Leroy" def test_conference_dates(record, recordfix): assert record.conference_dates() == "6 - 11 Dec 2010" assert recordfix.conference_dates() == "6-11 Dec 2010" def test_first_author(record, recordfix): assert record.first_author() == "Leroy, Olivier" assert recordfix.first_author() == "O. Leroy" def test_first_institutes(record, recordfix): assert record.first_author_institutes() == "Marseille, CPPM" assert recordfix.first_author_institutes() == "Marseille, CPPM" def test_institutes(record, recordfix): assert record.institutes() == ['Marseille, CPPM'] assert record.is_affiliation_for_all() == True assert recordfix.institutes() == ["Marseille, CPPM"] assert recordfix.is_affiliation_for_all() == True def test_submitted(record, recordfix): assert record.submitted() == ["05 Jan 2012"] assert recordfix.submitted() == ["2012-01-05"]