# -*- coding: utf-8 -*- """TALK http://cds.cern.ch/record/1550918 LHCb Upgrade R. Le Gac, Flavor Physics & CP Violation , Buzios, Rio, Brazil, 19 - 24 May 2013 No corrections are applied to the record. Allow to test the brute force decoding with its mistakes. Note: * Only first author defined """ import copy import pytest from harvest_tools import CheckAndFix, format_author_fr from invenio_tools import load_record @pytest.fixture(scope="module") def record(): return load_record('cds.cern.ch', 1550918) @pytest.fixture(scope="module") def recordfix(record): rec = copy.deepcopy(record) svc = CheckAndFix() svc.authors(rec) svc.country(rec) svc.conference_date(rec) svc.format_authors(rec, format_author_fr) svc.format_editor(rec) svc.submitted(rec) svc.year(rec) return rec def test_authors(record, recordfix): assert record.authors() == "Le Gac, R" assert recordfix.authors() == "R. Le Gac" def test_conference_dates(record, recordfix): assert record.conference_dates() == "19 - 24 May 2013" assert recordfix.conference_dates() == "19-24 May 2013" def test_conference_country(record, recordfix): assert record.conference_country() == "Brazil" assert recordfix.conference_country() == "Brazil" def test_conference_year(record, recordfix): assert record.conference_year() == "2013" assert recordfix.conference_year() == "2013" def test_first_author(record, recordfix): assert record.first_author() == "Le Gac, R" assert recordfix.first_author() == "R. Le Gac"