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

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