Commit 0d17cb9c authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Rename some of the RecordInst method.

parent b9260798
......@@ -43,14 +43,22 @@ class RecordInst(Record):
Record.__init__(self, record)
def future_id(self):
def future_identifier(self):
"""
Returns:
unicode: the future inspirehep id.
unicode: the future inspirehep identifier.
"""
return self[u"110"]["t"]
def identifier(self):
"""
Returns:
unicode: the current inspirehep identifier (2015).
"""
return self[u"110"]["u"]
def name(self):
"""
Returns:
......
......@@ -3,19 +3,19 @@
"""
import pytest
from invenio_tools import Institute, InstituteException, load_record
from invenio_tools import RecordInst, RecordException, load_record
def test_exception_arg():
with pytest.raises(InstituteException):
Institute("")
with pytest.raises(RecordException):
RecordInst("")
def test_exception_host():
record = load_record("cds.cern.ch", 1951625)
with pytest.raises(InstituteException):
Institute(record)
with pytest.raises(RecordException):
RecordInst(record)
def test_exception_record():
record = load_record("inspirehep.net", 1319638)
with pytest.raises(InstituteException):
Institute(record)
with pytest.raises(RecordException):
RecordInst(record)
......@@ -3,7 +3,7 @@
"""
import pytest
from invenio_tools import Institute, load_record, Record
from invenio_tools import load_record
@pytest.fixture(scope="module")
......@@ -11,12 +11,16 @@ def institute():
return load_record("inspirehep.net", 902989)
def test_future_id(institute):
assert institute.future_id() == u'CPPM, Marseille'
def test_future_identifer(institute):
assert institute.future_identifier() == u'CPPM, Marseille'
def test_id(institute):
assert institute.id() == u'Marseille, CPPM'
assert institute.id() == '902989'
def test_identifier(institute):
assert institute.identifier() == u'Marseille, CPPM'
def test_name(institute):
......
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