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

Update tests/issues/test_60_acti.py

parent 05432dd7
"""test_acti
"""test_60_acti
* collection of proceeding with issues
"""
import pytest
from harvest_tools.checkandfix import CheckAndFix
from gluon import current
from store_tools import load_record
@pytest.fixture(scope="module")
def svc():
return CheckAndFix()
def test_acti_cds1411352(svc):
def test_acti_cds1411352_60001():
"""
XML:
* Only the first authors is defined
......@@ -25,35 +18,35 @@ def test_acti_cds1411352(svc):
* Authors fix by the JSON encoding
* Other issues are treated by CheckAndFix
"""
reccds = load_record('cds.cern.ch', 1411352)
record = load_record('cds.cern.ch', 1411352)
assert reccds.authors() == "Leroy, Olivier"
assert reccds.conference_dates() == "6 - 11 Dec 2010"
assert reccds.submitted() == "05 Jan 2012"
assert record.authors() == "Leroy, Olivier"
assert record.conference_dates() == "6-11 Dec 2010"
assert record.submitted() == "05 Jan 2012"
svc.conference_date(reccds)
svc.submitted(reccds)
record.check_conference_date()
record.check_submitted_date()
assert reccds.conference_dates() == "6-11 Dec 2010"
assert reccds.submitted() == "2012-01-05"
assert record.conference_dates() == "6-11 Dec 2010"
assert record.submitted() == "2010-12-06"
def test_acti_cds2270937(svc):
def test_acti_cds2270937_60002():
"""
JSON:
* Author name not well formatted when using F. Last.
* More general design of the function recordpubli.to_initial
"""
reccds = load_record('cds.cern.ch', 2270937)
assert reccds.first_author() == "De Bruyn, Kristof Antoon M"
record = load_record('cds.cern.ch', 2270937)
assert record.first_author() == "De Bruyn, Kristof Antoon M"
svc.format_authors(reccds, fmt="F. Last")
record.check_format_authors(fmt="F. Last")
assert reccds.first_author() == "K. A. M. De Bruyn"
assert record.first_author() == "K. A. M. De Bruyn"
def test_acti_ins1276938(svc):
def test_acti_ins1276938_60003():
"""
XML:
* Only first author is defined
......@@ -67,15 +60,15 @@ def test_acti_ins1276938(svc):
* others issues are fixed by CheckAndFix
"""
recins = load_record('inspirehep.net', 1276938)
record = load_record('inspirehep.net', 1276938, shelf="literature")
assert recins.authors() == "Hubaut, F."
assert recins.first_author() == "Hubaut, F."
assert recins.collaboration() == "ATLAS"
assert recins.submitted() == ""
assert record.authors() == "Hubaut, F."
assert record.first_author() == "Hubaut, F."
assert record.collaboration() == "ATLAS"
assert record.submitted() == ""
svc.collaboration(recins)
svc.submitted(recins)
record.check_collaboration(current.db)
record.check_submitted_date()
assert recins.collaboration() == "ATLAS Collaboration"
assert recins.submitted() == "2013-03-02"
assert record.collaboration() == "ATLAS Collaboration"
assert record.submitted() == "2013-03-02"
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