Ejemplo n.º 1
0
def test_get_pdf__with_connect_timeout():
    with requests_mock.Mocker() as m:
        with pytest.raises(requests.exceptions.ConnectTimeout):
            m.get(requests_mock.ANY, exc=requests.exceptions.ConnectTimeout)
            html = cafenero.download_website()
            link = cafenero.extract_dropbox_link(html)
            cafenero.get_pdf(link)
Ejemplo n.º 2
0
def test_download_website__with_connect_timeout():
    with requests_mock.Mocker() as m:
        with pytest.raises(requests.exceptions.ConnectTimeout):
            m.get(requests_mock.ANY, exc=requests.exceptions.ConnectTimeout)
            cafenero.download_website()
Ejemplo n.º 3
0
def test_download_website__with_live_site():
    html = cafenero.download_website()
    assert '<iframe src="https://www.dropbox.com' in html
Ejemplo n.º 4
0
def pdf_file():
    html = cafenero.download_website()
    link = cafenero.extract_dropbox_link(html)
    tmpdir_of_pdf = cafenero.get_pdf(link)
    return tmpdir_of_pdf
Ejemplo n.º 5
0
def test_extract_dropbox_link():
    html = cafenero.download_website()
    link = cafenero.extract_dropbox_link(html)
    assert 'dropbox' in link
    assert 'speisekarte.pdf' in link
Ejemplo n.º 6
0
def test_download_website__with_live_site():
    html = cafenero.download_website()
    assert 'Speisekarte als' in html