Example #1
0
def test_open_file_not_found(mock_init_sample):
    with pytest.raises(ValueError,
            match="Requested PDF file 'AASteam2018.pdf' does not exist "
                 f"in database PDF dir '{u.BM_PDF()[:-1]}'"):
        pm.open(pdf='AASteam2018.pdf')
Example #2
0
def test_open_no_pdf(mock_init_sample):
    with pytest.raises(ValueError,
            match='Entry does not have a PDF in the database'):
        pm.open(key='AASteamHendrickson2018aastex62')
Example #3
0
def test_open_no_bibtex(mock_init_sample):
    with pytest.raises(ValueError,
            match='Requested entry does not exist in database'):
        pm.open(key='AASteamHendrickson2018')
Example #4
0
def test_open_nones(mock_init_sample):
    with pytest.raises(ValueError,
            match='At least one of the arguments must be not None'):
        pm.open()