Commit 11d01d97 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Restore tests/invenio_tools/Record.

parent fe4859a0
......@@ -64,6 +64,21 @@ def test_find_affiliation(record):
assert affiliation == "Marseille, CPPM"
def test_find_authors(record):
assert record.find_authors("Leo") == u"Beaucourt, Leo|Kravchuk, Leonid|Leo, Sabato"
def test_find_authors_by_affiliation(record):
pattern = "CPPM, Marseille|Marseille, CPPM"
authors = record.find_authors_by_affiliation(pattern)
assert authors == u"Akar, Simon|Aslanides, Elie|Cogan, Julien|" \
u"Kanso, Walaa|Le Gac, Renaud|Leroy, Olivier|" \
u"Mancinelli, Giampiero|Mordà, Alessandro|" \
u"Perrin-Terrin, Mathieu|Serrano, Justine|" \
u"Tsaregorodtsev, Andrei"
def test_first_author(record):
assert record.first_author() == "Aaij, Roel"
......@@ -99,7 +114,7 @@ def test_oai(record):
def test_paper_reference(record):
assert record.paper_editor() == "J. Instrum."
assert record.paper_editor() == "JINST"
assert record.paper_pages() == "P12005"
assert record.paper_volume() == "9"
assert record.paper_year() == "2014"
......
......@@ -29,9 +29,9 @@ def record():
def test_affiliations(record):
assert record.is_affiliations() == False
assert record.is_affiliation_for_all() == False
assert record.institutes() == []
assert record.is_affiliations() == True
assert record.is_affiliation_for_all() == True
assert record.institutes() == ["Marseille, CPPM"]
def test_authors(record):
......@@ -80,7 +80,7 @@ def test_first_author(record):
def test_first_institutes(record):
assert record.first_author_institutes() == ""
assert record.first_author_institutes() == "Marseille, CPPM"
def test_host(record):
......@@ -145,4 +145,4 @@ def test_title(record):
def test_year(record):
assert record.year() == ""
assert record.year() == "2013"
......@@ -51,7 +51,7 @@ def test_first_author(record):
def test_first_institutes(record):
assert record.first_author_institutes() == "Shandong U., Marseille, CPPM"
assert record.first_author_institutes() == "Shandong U.|Marseille, CPPM"
def test_host(record):
......@@ -104,7 +104,7 @@ def test_these_level(record):
def test_these_directors(record):
assert record.these_directors() == "He, Mao, Monnier, Emmanuel, Zhu, Chengguang"
assert record.these_directors() == "He, Mao|Monnier, Emmanuel|Zhu, Chengguang"
def test_these_town(record):
......
......@@ -21,10 +21,10 @@ def test_protection_find_authors_by_affiliation():
record = load_record('cds.cern.ch', 2012165)
pattern = "Marseille, CPPM|CPPM, Marseille"
authors = record.find_authors_by_affiliation(pattern)
assert authors == u"Akar, Simon, Aslanides, Elie, Cogan, Julien, " \
u"Kanso, Walaa, Le Gac, Renaud, Leroy, Olivier, " \
u"Mancinelli, Giampiero, Mordà, Alessandro, " \
u"Serrano, Justine, Tsaregorodtsev, Andrei"
assert authors == u"Akar, Simon|Aslanides, Elie|Cogan, Julien|" \
u"Kanso, Walaa|Le Gac, Renaud|Leroy, Olivier|" \
u"Mancinelli, Giampiero|Mordà, Alessandro|" \
u"Serrano, Justine|Tsaregorodtsev, Andrei"
def test_protection_first_author():
......@@ -48,7 +48,7 @@ def test_protection_paper_year():
def test_protection_paper_url():
record = load_record('cds.cern.ch', 2014733)
assert record.paper_url() == "http://arxiv.org/pdf/1505.01654"
assert record.paper_url() == "http://cds.cern.ch/record/2014733/files/arXiv:1505.01654.pdf"
def test_protection_year():
......
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