Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit c7663468 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update to pass all harvest_tools tests.

parent 38150847
......@@ -592,7 +592,7 @@ class CheckAndFix(object):
# Other: replace U. by University
else:
university = current.T(UNIVERSITY)
university = current.T(UNIVERSITY, lazy=False)
if "502" in record and "b" in record["502"]:
if isinstance(record["502"]["b"], str):
......
......@@ -40,18 +40,21 @@ def test_paper_editor(record, recordfix):
def test_paper_page(record, recordfix):
assert record.paper_pages() == "75"
# 191119 fix in CDS
assert record.paper_pages() == "158"
assert recordfix.paper_pages() == "158"
def test_paper_volume(record, recordfix):
assert record.paper_volume() == ""
assert recordfix.paper_volume() == "75"
# 191119 fix in CDS
assert record.paper_volume() == "C75"
assert recordfix.paper_volume() == "C75"
def test_paper_reference(record, recordfix):
assert record.paper_reference() == "Eur. Phys. J. C 2015 75"
assert recordfix.paper_reference() == "Eur. Phys. J. C 75 2015 158"
# 191119 fix in CDS
assert record.paper_reference() == "Eur. Phys. J. C C75 2015 158"
assert recordfix.paper_reference() == "Eur. Phys. J. C C75 2015 158"
def test_paper_year(record, recordfix):
......
......@@ -64,14 +64,6 @@ def test_find_authors_by_affiliation(recordfix):
svc = CheckAndFix()
rex = svc._get_reg_institute()
references = set([
"CPPM, Marseille",
"Centre de Physique des Particules de Marseille \\(CPPM\\)",
"Marseille, CPPM"])
values = set(rex.split("|"))
assert values == references
authors = recordfix.find_authors_by_affiliation(rex)
assert authors.split(', ') == CPPM_AUTHORS
......@@ -113,16 +105,18 @@ def test_my_affiliation(record):
value = svc.my_affiliation(rec, id_project, id_team, "F. Last")
assert value == ""
assert svc._my_authors[record.id()] == [
'R. Le Gac',
'M. Perrin-Terrin',
'E. Aslanides',
'J. Cogan',
'J. Serrano',
'W. Kanso',
'S. Akar',
'O. Leroy',
'G. Mancinelli']
assert set(svc._my_authors[record.id()]) == {
"S. Akar",
"E. Aslanides",
"J. Cogan",
"W. Kanso",
"R. Le Gac",
"O. Leroy",
"G. Mancinelli",
"A. Mordà",
"M. Perrin-Terrin",
"J. Serrano"}
def test_my_authors(recordfix):
assert recordfix.my_authors.split(', ') == CPPM_AUTHORS
......
......@@ -27,6 +27,7 @@ from invenio_tools import load_record
def record():
return load_record('cds.cern.ch', 1632177)
@pytest.fixture(scope="module")
def recordfix(record):
rec = copy.deepcopy(record)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment