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

Reorganise test_03_Record

parent 6fcfceaf
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
Test all methods of the Record class for a given article: Test all methods of the Record class for a given article:
https://cds.cern.ch/record/1951625. https://cds.cern.ch/record/1951625.
(same as https://inspirehep.net/record/1319638) same as https://old.inspirehep.net/record/1319638
same as https://inspirehep.net/api/literature/1319638
Precision luminosity measurements at LHCb, Precision luminosity measurements at LHCb,
J. Instrum. 9 (2014) P12005 J. Instrum. 9 (2014) P12005
...@@ -30,6 +31,11 @@ def recins(): ...@@ -30,6 +31,11 @@ def recins():
recjson = store.get_record(1319638) recjson = store.get_record(1319638)
return Record(recjson) return Record(recjson)
# ............................................................................
#
# from cds.cern.ch
#
def test__get_cds_03001(reccds): def test__get_cds_03001(reccds):
assert reccds._get("subject", "source") == "arXiv" assert reccds._get("subject", "source") == "arXiv"
...@@ -45,28 +51,27 @@ def test__oai_url_cds_03002(reccds): ...@@ -45,28 +51,27 @@ def test__oai_url_cds_03002(reccds):
assert reccds._oai_url(oai) == "http://cds.cern.ch/record/1951625" assert reccds._oai_url(oai) == "http://cds.cern.ch/record/1951625"
def test_id_cds_03003(reccds): def test_host_cds_03003(reccds):
assert reccds.host() == "cds.cern.ch"
def test_id_cds_03004(reccds):
assert reccds.id() == 1951625 assert reccds.id() == 1951625
def test_primary_oai_cds_03004(reccds): def test_primary_oai_cds_03005(reccds):
assert reccds.primary_oai() == "oai:cds.cern.ch:1951625" assert reccds.primary_oai() == "oai:cds.cern.ch:1951625"
def test_primary_oai_ins_03005(recins): def test_secondary_oai_cds_03006(reccds):
assert recins.primary_oai() == "oai:inspirehep.net:1319638" assert reccds.secondary_oai() == "oai:inspirehep.net:1319638"
def test_oai_03006(reccds): def test_oai_cds_03007(reccds):
assert reccds.oai() == \ assert reccds.oai() == \
"oai:cds.cern.ch:1951625, oai:inspirehep.net:1319638" "oai:cds.cern.ch:1951625, oai:inspirehep.net:1319638"
def test_oai_ins_03007(reccds, recins):
assert recins.oai() == \
"oai:inspirehep.net:1319638, oai:cds.cern.ch:1951625"
def test_primary_oai_url_cds_03008(reccds): def test_primary_oai_url_cds_03008(reccds):
assert reccds.primary_oai_url() == "http://cds.cern.ch/record/1951625" assert reccds.primary_oai_url() == "http://cds.cern.ch/record/1951625"
...@@ -80,10 +85,20 @@ def test_oai_url_cds_03010(reccds): ...@@ -80,10 +85,20 @@ def test_oai_url_cds_03010(reccds):
"http://cds.cern.ch/record/1951625, " \ "http://cds.cern.ch/record/1951625, " \
"http://inspirehep.net/record/1319638" "http://inspirehep.net/record/1319638"
# ............................................................................
def test_host_cds_03011(reccds): #
assert reccds.host() == "cds.cern.ch" # from inspirehep.net
#
def test_host_ins_03012(recins): def test_host_ins_03012(recins):
assert recins.host() == "inspirehep.net" assert recins.host() == "inspirehep.net"
def test_primary_oai_ins_03013(recins):
assert recins.primary_oai() == "oai:inspirehep.net:1319638"
def test_oai_ins_03014(reccds, recins):
assert recins.oai() == \
"oai:inspirehep.net:1319638, oai:cds.cern.ch: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