From 2d5e4da13b2706b1b24a3919268c81b3ea6eb010 Mon Sep 17 00:00:00 2001 From: Mohan Kumar Date: Fri, 9 Jul 2021 13:29:29 +0530 Subject: [PATCH] test for invalid url coverage for is_url --- tests/test_errors.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_errors.py b/tests/test_errors.py index eaa720ec..41262c13 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -1,5 +1,6 @@ import os import warnings +from camelot.utils import is_url import pytest @@ -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