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

Update test_01_store to check access to the HAL Hidden collection

parent f8f57a5e
......@@ -14,7 +14,11 @@ def test_build_store_exception_01001():
build_store("inspirehep", shelf="foo")
def test_get_ids_cds_01002():
# ............................................................................
#
# get_ids
#
def test_get_ids_cds_01010():
"""Check the list of record ids for LHCb articles published in 2015.
"""
......@@ -44,10 +48,11 @@ def test_get_ids_cds_01002():
assert set(rec_ids).difference(ref_2020_ids) == set()
def test_get_ids_ins_01003():
def test_get_ids_ins_01011():
"""Check the list of record ids for LHCb articles published in 2010.
"""
# new inspirehep interface (March 2020)
store = build_store("inspirehep.net", shelf="literature")
ids = store.get_ids(q="find cn lhcb and tc p and not tc c and date 2010")
......@@ -56,53 +61,100 @@ def test_get_ids_ins_01003():
assert set(ids) == ref_2019_ids
def test_get_ids_exception_01004():
def test_get_ids_exception_01012():
store = build_store("inspirehep.net", shelf="conferences")
assert store.get_ids(q="find cn lhcb") == []
def test_get_record_cds_01005():
# ............................................................................
#
# get_record
#
def test_get_record_cds_01020():
store = build_store("cds.cern.ch")
recjson = store.get_record(1951625)
assert isinstance(recjson, dict)
def test_get_record_ins_none_01006():
def test_get_record_ins_old_01021():
# old inspirehep interface
store = build_store("inspirehep.net", shelf=None)
recjson = store.get_record(1319638)
assert isinstance(recjson, dict)
assert recjson.get("$schema", None) is None
def test_get_record_ins_literature_01007():
# old inspirehep interface (new one not yet available)
def test_get_record_ins_literature_01022():
# new inspirehep interface (March 2020)
store = build_store("inspirehep.net", shelf="literature")
recjson = store.get_record(1319638)
assert isinstance(recjson, dict)
assert recjson.get("$schema", None) is not None
def test_get_record_ins_conferences_01008():
# new inspirehep interface for conferences
def test_get_record_ins_conferences_01023():
# new inspirehep interface (March 2020)
store = build_store("inspirehep.net", shelf="conferences")
recjson = store.get_record(980401)
assert recjson["cnum"] == "C10-12-06"
assert recjson.get("$schema", None) is not None
def test_get_record_ins_institutions_01009():
# old inspirehep interface (new one not yet available)
def test_get_record_ins_institutions_01024():
# new inspirehep interface (March 2020)
store = build_store("inspirehep.net", shelf="institutions")
recjson = store.get_record(902989)
assert isinstance(recjson, dict)
assert recjson.get("$schema", None) is not None
def test_get_field_ins_01010():
# ............................................................................
#
# get_field
#
def test_get_field_ins_01030():
# new inspirehep interface (March 2020)
store = build_store("inspirehep.net", shelf="literature")
value = store.get_field(1319638, "citation_count")
assert isinstance(value, int)
def test_search_ins_01011():
# new inspirehep interface for conferences
# ............................................................................
#
# search
#
def test_search_ins_01040():
# new inspirehep interface (March 2020)
store = build_store("inspirehep.net", shelf="conferences")
obj = store.search(q="cnum:C10-12-06")
assert len(obj) == 1 and obj[0]["metadata"]["cnum"] == "C10-12-06"
# ............................................................................
#
# test access to the collection HAL Hidden
#
def test_get_ids_ins_hall_hidden_01050():
# new inspirehep interface (March 2020)
store = build_store("inspirehep.net", shelf="literature")
query = "find cc HAL Hidden "\
"a simpson, g or a thiamova, g or a ramdhane, m and not tc c"
lst = store.get_ids(q=query)
assert len(lst) > 47
def test_search_ins_hal_hidden_01051():
# new inspirehep interface (March 2020)
store = build_store("inspirehep.net", shelf="literature")
query = "find cc HAL Hidden "\
"a simpson, g or a thiamova, g or a ramdhane, m and not tc c"
lst = store.search(q=query)
assert len(lst) > 47
assert "metadata" in lst[0]
assert "links" in lst[0]
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