Commit 9bba88a5 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update test_03_Record to add test for RecordHep

parent f531e739
...@@ -16,6 +16,7 @@ import pytest ...@@ -16,6 +16,7 @@ import pytest
from store_tools.factory import build_store from store_tools.factory import build_store
from store_tools.record import Record from store_tools.record import Record
from store_tools.recordhep import RecordHep
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
...@@ -29,7 +30,7 @@ def reccds(): ...@@ -29,7 +30,7 @@ def reccds():
def recins(): def recins():
store = build_store("inspirehep.net", shelf="literature") store = build_store("inspirehep.net", shelf="literature")
recjson = store.get_record(1319638) recjson = store.get_record(1319638)
return Record(recjson) return RecordHep(recjson)
# ............................................................................ # ............................................................................
# #
...@@ -91,14 +92,38 @@ def test_oai_url_cds_03010(reccds): ...@@ -91,14 +92,38 @@ def test_oai_url_cds_03010(reccds):
# #
def test_host_ins_03012(recins): def test_host_ins_03023(recins):
assert recins.host() == "inspirehep.net" assert recins.host() == "inspirehep.net"
def test_primary_oai_ins_03013(recins): def test_host_ins_03024(recins):
assert recins.id() == 1319638
def test_primary_oai_ins_03025(recins):
assert recins.primary_oai() == "oai:inspirehep.net:1319638" assert recins.primary_oai() == "oai:inspirehep.net:1319638"
def test_oai_ins_03014(reccds, recins): def test_secondary_oai_ins_03026(recins):
assert recins.secondary_oai() == "oai:cds.cern.ch:1951625"
def test_oai_ins_03027(recins):
assert recins.oai() == \ assert recins.oai() == \
"oai:inspirehep.net:1319638, oai:cds.cern.ch:1951625" "oai:inspirehep.net:1319638, " \
"oai:cds.cern.ch:1951625"
def test_primary_oai_url_ins_03028(recins):
assert recins.primary_oai_url() == \
"https://inspirehep.net/api/literature/1319638"
def test_secondary_oai_url_ins_03029(recins):
assert recins.secondary_oai_url() == "https://cds.cern.ch/record/1951625"
def test_oai_url_ins_03030(recins):
assert recins.oai_url() == \
"https://inspirehep.net/api/literature/1319638, "\
"https://cds.cern.ch/record/1951625"
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