Beispiel #1
0
def test_extract_references_from_file(pdf_files):
    r = extract_references_from_file(pdf_files[0])
    assert 'texkey' in r[0]
    assert 'author' in r[0]
    assert len(r) == 36
    with pytest.raises(FullTextNotAvailableError):
        extract_references_from_file(pdf_files[0] + "error")
Beispiel #2
0
def test_long_registrant_dois(pdf_files):
    """ DOIs with 5 digit registrant code """
    r = extract_references_from_file(pdf_files[6])
    assert len(r) == 6
    for ref in r[1:]:
        assert 'doi' in ref
        assert ref.get('doi')[0].startswith(u'doi:10.18429/JACoW')
Beispiel #3
0
def test_extract_references_from_file():
    path_to_pdf = os.path.join(
        os.path.dirname(__file__),
        'data',
        '1503.07589v1.pdf'
    )

    r = extract_references_from_file(path_to_pdf)
    assert len(r['references']) == 36
Beispiel #4
0
def test_extract_references_from_file():
    path_to_pdf = os.path.join(os.path.dirname(__file__), "data", "1503.07589v1.pdf")

    r = extract_references_from_file(path_to_pdf)
    assert len(r["references"]) == 36