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

Rename RecordHepConf as RecordHepConfPaper

parent c8095367
......@@ -14,7 +14,7 @@ from store_tools import (CheckException,
RecordCdsConf,
RecordCdsPubli,
RecordCdsThesis,
RecordHepConf,
RecordHepConfPaper,
RecordHepPubli,
RecordHepThesis,
REG_OAI,
......@@ -321,7 +321,7 @@ class CheckAndFix(object):
opening = self._get_conference_dates(record)[0]
val = opening.strftime("%Y-%m-%d")
elif isinstance(record, RecordHepConf):
elif isinstance(record, RecordHepConfPaper):
opening = record.get("opening_data", None)
if opening is not None:
......@@ -743,7 +743,7 @@ class CheckAndFix(object):
if "meeting_name" in record:
return
if isinstance(record, RecordHepConf):
if isinstance(record, RecordHepConfPaper):
if getattr(record, "conference", None) is not None:
return
......
......@@ -40,7 +40,7 @@ from .cdsstore import CdsStore
from .recordcdsconf import RecordCdsConf
from .recordcdspubli import RecordCdsPubli
from .recordcdsthesis import RecordCdsThesis
from .recordhepconf import RecordHepConf
from .recordhepconfpaper import RecordHepConfPaper
from .recordhepinst import RecordHepInst
from .recordheppubli import RecordHepPubli
from .recordhepthesis import RecordHepThesis
......@@ -76,7 +76,7 @@ def load_record(host, record_id, shelf=None):
Returns:
RecordCds:
either RecordCdsConf, RecordHepConf, RecodHepPubli, RecordHepInst,
either RecordCdsConf, RecordHepConfPaper, RecodHepPubli, RecordHepInst,
RecordHepThesis, RecordHepInst, RecordCdsPubli or RecordCdsThesis
Raises:
......
......@@ -17,7 +17,7 @@ from .exception import RecordException, StoreException
from .cdsstore import CdsStore
from .inspirehepstore import InspirehepStore, SHELFS
from .recordcdsconf import RecordCdsConf
from .recordhepconf import RecordHepConf
from .recordhepconfpaper import RecordHepConfPaper
from .recordheppubli import RecordHepPubli
from .recordhepinst import RecordHepInst
from .recordhepthesis import RecordHepThesis
......@@ -185,7 +185,7 @@ def build_record(recjson, shelf=None):
Return
Record:
either RecordCdsConf, RecordHepConf, RecodHepPubli, RecordHepInst,
either RecordCdsConf, RecordHepConfPaper, RecodHepPubli, RecordHepInst,
RecordHepThesis, RecordHepInst, RecordCdsPubli or RecordCdsThesis
Raises:
......@@ -212,7 +212,7 @@ def build_record(recjson, shelf=None):
else:
if is_conference(recjson) and shelf == "literature":
upcast_record = RecordHepConf(recjson)
upcast_record = RecordHepConfPaper(recjson)
elif shelf == "institutions":
upcast_record = RecordHepInst(recjson)
......
""" store_tools.recordhepconf
""" store_tools.recordhepconfpaper
"""
import requests
......@@ -8,7 +8,7 @@ from plugin_dbui import CLEAN_SPACES
from .recordheppubli import RecordHepPubli
class RecordHepConf(RecordHepPubli):
class RecordHepConfPaper(RecordHepPubli):
"""Conference proceeding from inspirehep.net version 2.
Schema for conference paper is documented here:
......@@ -27,7 +27,12 @@ class RecordHepConf(RecordHepPubli):
super().__init__(recjson)
self.conference = None
self._process_conference_data()
def _process_conference_data(self):
"""Append the conference record.
"""
# get the URL of the conference record in inspirehep.net
publication_info = self.get("publication_info", None)
if publication_info is None:
......
......@@ -18,7 +18,7 @@ from store_tools.authorsmixin import to_initial
from store_tools.recordcdsconf import RecordCdsConf
from store_tools.recordcdspubli import RecordCdsPubli
from store_tools.recordcdsthesis import RecordCdsThesis
from store_tools.recordhepconf import RecordHepConf
from store_tools.recordhepconfpaper import RecordHepConfPaper
from store_tools.recordhepinst import RecordHepInst
from store_tools.recordheppubli import RecordHepPubli
from store_tools.recordhepthesis import RecordHepThesis
......@@ -117,7 +117,7 @@ def test_conference_ins_02007():
assert not is_thesis(recjson)
record = build_record(recjson, shelf="literature")
assert isinstance(record, RecordHepConf)
assert isinstance(record, RecordHepConfPaper)
def test_talk_cds_02008():
......
"""test_07_RecordHepConf
"""test_07_RecordHepConfPaper
Test specific methods of the RecordConf class for ::
......@@ -22,7 +22,7 @@ Note:
import pytest
from store_tools import load_record
from store_tools.recordhepconf import RecordHepConf
from store_tools.recordhepconfpaper import RecordHepConfPaper
@pytest.fixture(scope="module")
......@@ -31,7 +31,7 @@ def record():
def test_upcast_ins_07001(record):
assert isinstance(record, RecordHepConf)
assert isinstance(record, RecordHepConfPaper)
def test_conference_location_ins_07002(record):
......
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