diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-01-05 11:18:31 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-01-05 11:19:15 +0100 |
commit | 7faf68ec3f9cfea61e47be74407a816110dc522d (patch) | |
tree | fa3dd0776298b99875fb8a71984ec5cc7ef6e84b | |
parent | ebb3046822adbeeb6bea10e79669d82420cb7f3b (diff) | |
download | qutebrowser-7faf68ec3f9cfea61e47be74407a816110dc522d.tar.gz qutebrowser-7faf68ec3f9cfea61e47be74407a816110dc522d.zip |
urlutils: Add tests for invalid data: URL
-rw-r--r-- | tests/unit/utils/test_urlutils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/unit/utils/test_urlutils.py b/tests/unit/utils/test_urlutils.py index fda4e45d9..13c94d00e 100644 --- a/tests/unit/utils/test_urlutils.py +++ b/tests/unit/utils/test_urlutils.py @@ -557,12 +557,13 @@ def test_raise_cmdexc_if_invalid(url, valid, has_err_string): (QUrl('data:application/pdf,'), 'download.pdf'), (QUrl('data:foo/bar,'), 'download'), # unknown extension (QUrl('data:text/xul,'), 'download.xul'), # strict=False + (QUrl('data:'), None), # invalid data URL ]) def test_filename_from_url(qurl, output): assert urlutils.filename_from_url(qurl) == output -@pytest.mark.parametrize('qurl', [QUrl(), QUrl('qute://')]) +@pytest.mark.parametrize('qurl', [QUrl(), QUrl('qute://'), QUrl('data:')]) def test_filename_from_url_fallback(qurl): assert urlutils.filename_from_url(qurl, fallback='fallback') == 'fallback' |