From a090e4d0344c2732de3a9606a5bcc779b615205b Mon Sep 17 00:00:00 2001 From: akkuldn Date: Fri, 9 Jul 2021 12:39:35 +0530 Subject: [PATCH] TEST TO CHECK UNSUPPORTED URL Added test to check if the error message is displayed accurately when an unsupported url is passed --- tests/test_errors.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_errors.py b/tests/test_errors.py index 595c54b..1399a6e 100755 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -118,3 +118,9 @@ def test_bad_password(): message = "file has not been decrypted" with pytest.raises(Exception, match=message): tables = camelot.read_pdf(filename, password="wrongpass") + +def test_content_type(): + url="https://camelot-py.readthedocs.io/en/master/_static/csv/foo.csv" + message = "File format not supported" + with pytest.raises(NotImplementedError, match=message): + tables = camelot.read_pdf(url)