Exemple #1
0
def test_grobid_without_match(inspire_app):
    query = "jessica"

    expected = None

    result = get_reference_from_grobid(query)
    assert expected == result
Exemple #2
0
 def query_string_to_reference_object_or_none(query_string):
     try:
         return get_reference_from_grobid(query_string)
     except RequestException:
         LOGGER.exception("Request error from GROBID.",
                          query_string=query_string)
     except Exception:
         LOGGER.exception("Error processing reference from GROBID",
                          query_string=query_string)
     return None
Exemple #3
0
def test_grobid_with_match(inspire_app):
    query = "[27] K. P. Das and R. C. Hwa, Phys. Lett. B 68, 459 (1977);"

    expected = {
        "reference": {
            "publication_info": {
                "journal_title": "Phys. Lett. B",
                "journal_volume": "68",
                "page_start": "459",
                "year": 1977,
            }
        }
    }
    result = get_reference_from_grobid(query)
    assert expected == result