Commit 85e065c7 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update test_80_phd.py

parent 8edcaeb6
# -*- coding: utf-8 -*-
"""test_phd
"""test_80_phd
* collection of phd theses with issues
"""
import pytest
from harvest_tools.checkandfix import CheckAndFix
from store_tools import load_record
from store_tools import CheckException, load_record
@pytest.fixture(scope="module")
def svc():
return CheckAndFix()
def test_phd_cds1394605(svc):
def test_phd_cds1394605_80001():
"""
XML:
* Only the first author is defined
......@@ -29,24 +22,24 @@ def test_phd_cds1394605(svc):
* Nothing can be done for the defence date
"""
reccds = load_record('cds.cern.ch', 1394605)
record = load_record('cds.cern.ch', 1394605)
assert reccds.authors() == u"Khanji, Basem"
assert reccds.first_author() == u"Khanji, Basem"
assert reccds.first_author_institutes() == u"Marseille, CPPM"
assert reccds.these_defense() == "2011"
assert reccds.these_universities() == u"Marseille U., Luminy"
assert reccds.submitted() == ""
assert record.authors() == u"Khanji, Basem"
assert record.first_author() == u"Khanji, Basem"
assert record.first_author_institutes() == u"Marseille, CPPM"
assert record.these_defense() == "2011"
assert record.these_universities() == u"Marseille U., Luminy"
assert record.submitted() == ""
svc.submitted(reccds)
svc.format_universities(reccds)
assert reccds.submitted() == "2011-11"
assert reccds.these_universities() == \
record.format_universities()
assert record.these_universities() == \
u"Université de la Méditerrannée Aix-Marseille II"
with pytest.raises(CheckException):
record.check_submitted_date()
def test_phd_cds1632177(svc):
def test_phd_cds1632177_80002():
"""
XML:
* Only the first author is defined
......@@ -59,20 +52,20 @@ def test_phd_cds1632177(svc):
* Submitted date and University names are fixed by CheckAndFix
"""
reccds = load_record('cds.cern.ch', 1632177)
record = load_record('cds.cern.ch', 1632177)
assert reccds.authors() == u"Chen, Liming"
assert reccds.first_author() == u"Chen, Liming"
assert reccds.first_author_institutes() == u"Shandong U.|Marseille, CPPM"
assert reccds.these_universities() == u"Shandong U. & Marseille, CPPM"
assert reccds.submitted() == ""
assert record.authors() == u"Chen, Liming"
assert record.first_author() == u"Chen, Liming"
assert record.first_author_institutes() == u"Shandong U.|Marseille, CPPM"
assert record.these_universities() == u"Shandong U. & Marseille, CPPM"
assert record.submitted() == ""
svc.submitted(reccds)
svc.format_universities(reccds)
record.check_submitted_date()
record.format_universities()
assert reccds.first_author_institutes() == u"Shandong U.|Marseille, CPPM"
assert record.first_author_institutes() == u"Shandong U.|Marseille, CPPM"
assert reccds.these_universities() == \
assert record.these_universities() == \
u"Shandong Université & Aix Marseille Université"
assert reccds.submitted() == "2013-12-10"
assert record.submitted() == "2013-12-10"
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