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

Basic tests from 01 to 07 passed.

parent 76a3ae99
......@@ -10,13 +10,19 @@ class RecordConf(RecordPubli):
"""The record describing a conference talk or a proceeding.
Additional field describing the conference data are::
+---------------+-----------------------------------------------+
| field | subfield |
+---------------+-----------------------------------------------+
| meeting_name | closing_date, coference_code, country, date, |
| | location, opening_date, year |
| meeting_note | recid, url |
+---------------+-----------------------------------------------+
+----------------+-----------------------------------------------+
| field | subfield |
+----------------+-----------------------------------------------+
| meeting_name | closing_date, coference_code, country, date, |
| | location, opening_date, year |
+----------------+-----------------------------------------------+
One field is added by limbra:
+----------------+-----------------------------------------------+
| field (limbra) | subfield |
+----------------+-----------------------------------------------+
| meeting_note | recid, url |
+----------------+-----------------------------------------------+
"""
def conference_country(self):
......
......@@ -250,7 +250,12 @@ class RecordPubli(Record):
lambda x: (", ".join(set(x)) if isinstance(x, list) else x))
# erratum -- sort by year and volume
df = df.sort_values(["year", "volume"])
columns = df.columns
if set(["year", "volume"]).issubset(columns):
df = df.sort_values(["year", "volume"])
elif "year" in columns:
df = df.sort_values("year")
# replace
self[u"publication_info"] = df
......
......@@ -178,7 +178,9 @@ def test_add_affiliation_keys():
assert u"corporate_note" in recjson
assert recjson[u"corporate_note"][u"identifier"] == "Marseille, CPPM"
assert recjson[u"corporate_note"][u"futur_identifier"] == "CPPM, Marseille"
assert recjson[u"corporate_note"][u"future_identifier"] == \
"CPPM, Marseille"
def test_institute():
......
......@@ -13,20 +13,25 @@ Test all methods of the Record class for a given article:
"""
import pytest
from invenio_tools import load_record
from invenio_tools.inveniostore import InvenioStore
from invenio_tools.record import Record
@pytest.fixture(scope="module")
def reccds():
return load_record("cds.cern.ch", 1951625)
store = InvenioStore("cds.cern.ch")
recjson = store.get_record(1951625)
return Record(recjson)
@pytest.fixture(scope="module")
def recins():
return load_record("inspirehep.net", 1319638)
store = InvenioStore("inspirehep.net")
recjson = store.get_record(1319638)
return Record(recjson)
def test_get(reccds):
def test__get(reccds):
assert reccds._get("subject", "source") == "arXiv"
assert reccds._get("subject", "source", force_list=True) == ["arXiv"]
......
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