From 49ead32f1379c5fffe24dba083c980a2de732cf8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 23 Feb 2018 06:31:49 +0100 Subject: [PATCH] Update urlmatch tests for Chromium changes See: https://chromium.googlesource.com/chromium/src/+/0ab1294c92dfab538b185f0f25f44f6491a49759%5E%21/ https://bugs.chromium.org/p/chromium/issues/detail?id=812543 --- tests/unit/utils/test_urlmatch.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/unit/utils/test_urlmatch.py b/tests/unit/utils/test_urlmatch.py index 9cad6033b..cb4e41767 100644 --- a/tests/unit/utils/test_urlmatch.py +++ b/tests/unit/utils/test_urlmatch.py @@ -53,6 +53,7 @@ from qutebrowser.utils import urlmatch ("http://", "Pattern without host"), ("http:///", "Pattern without host"), ("http:// /", "Pattern without host"), + ("http://:1234/", "Pattern without host"), # Chromium: PARSE_ERROR_EMPTY_PATH # We deviate from Chromium and allow this for ease of use @@ -94,8 +95,8 @@ def test_invalid_patterns(pattern, error): ("http://foo:1234/bar", 1234), ("http://*.foo:1234/", 1234), ("http://*.foo:1234/bar", 1234), - # https://bugs.chromium.org/p/chromium/issues/detail?id=812543 - # ("http://:1234/", 1234), + ("http://*:1234/", 1234), + ("http://*:*/", None), ("http://foo:*/", None), ("file://foo:1234/bar", None), @@ -253,7 +254,7 @@ class TestMatchChromeUrls: class TestMatchAnything: - @pytest.fixture(params=['*://*/*', '']) + @pytest.fixture(params=['*://*/*', '*://*:*/*', '']) def up(self, request): return urlmatch.UrlPattern(request.param)