Skip to content

Commit

Permalink
test for invalid url
Browse files Browse the repository at this point in the history
coverage for is_url
  • Loading branch information
mohanqxf2 authored and bosd committed Sep 19, 2024
1 parent 24ed700 commit 2d5e4da
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_errors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import warnings
from camelot.utils import is_url

import pytest

Expand Down Expand Up @@ -141,3 +142,11 @@ def test_lattice_ghostscript_deprecation_warning(foo_pdf):
with pytest.raises(DeprecationWarning) as e:
camelot.read_pdf(foo_pdf)
assert str(e.value) == ghostscript_deprecation_warning


def test_invalid_url():
url = 'fttp://google.com/pdf'
message = "File format not supported"
with pytest.raises(Exception, match=message):
url = camelot.read_pdf(url)
assert is_url(url) == False

0 comments on commit 2d5e4da

Please sign in to comment.