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

Update test_11_CheckAndFix to inhibit 11012

parent 0c70e367
......@@ -155,11 +155,32 @@ def test_search_ins_01041():
assert len(obj) == 0
# ............................................................................
#
# search_parameter
#
def test_search_parameter_ins_01050():
# new inspirehep interface (March 2020)
store = build_store("inspirehep.net", shelf="conferences")
collection = "find a j caar or a h costantini or a anguner"
ref = "find (a j caar or a h costantini or a anguner)"
dct = store.search_parameters(collection)
print(dct["q"])
assert dct["q"] == ref
dct = store.search_parameters(collection, 2020)
assert dct["q"] == f"{ref} and date 2020"
dct = store.search_parameters(collection, 2020, 2021)
assert dct["q"] == f"{ref} and date 2020->2021"
# ............................................................................
#
# test access to the collection HAL Hidden
#
def test_get_ids_ins_hall_hidden_01050():
def test_get_ids_ins_hall_hidden_01060():
# new inspirehep interface (March 2020)
store = build_store("inspirehep.net", shelf="literature")
......@@ -171,7 +192,7 @@ def test_get_ids_ins_hall_hidden_01050():
assert len(lst) > 47
def test_search_ins_hal_hidden_01051():
def test_search_ins_hal_hidden_01061():
# new inspirehep interface (March 2020)
store = build_store("inspirehep.net", shelf="literature")
......
......@@ -52,23 +52,24 @@ def test_is_oai_cds_11010(svc, reccds):
def test_is_bad_oai_cds_11011(svc, reccds):
assert not svc.is_bad_oai_used(reccds)
def test_temporary_record_cds_11012(svc, reccds):
assert svc.temporary_record(reccds) is None
# look for some temporarily record in inspirehep.net
# using the MarcXML syntax
# get a list of recids
payload = {"p": "500__a:'*Temporary record*'", "of": "id", "rg": 10}
r = requests.get("https://old.inspirehep.net/search", params=payload)
li = r.json()
# try with the oldest one to avoid issue with missing information, etc.
with pytest.raises(CheckException):
recins = load_record("inspirehep.net", li[-1], shelf="literature")
svc.temporary_record(recins)
# v1.4.0 inhibit tempo rary record with the new inspirehep API (March 20)
#
# def test_temporary_record_cds_11012(svc, reccds):
#
# assert svc.temporary_record(reccds) is None
#
# # look for some temporarily record in inspirehep.net
# # using the MarcXML syntax
# # get a list of recids
# payload = {"p": "500__a:'*Temporary record*'", "of": "id", "rg": 10}
#
# r = requests.get("https://old.inspirehep.net/search", params=payload)
# li = r.json()
#
# # try with the oldest one to avoid issue with missing information, etc.
# with pytest.raises(CheckException):
# recins = load_record("inspirehep.net", li[-1], shelf="literature")
# svc.temporary_record(recins)
def test_authors_cds_11013(svc, reccds):
......
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