From 6c5876a494fbd6de4eb50f0e96acf9eab39af716 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 20 Feb 2018 23:08:09 +0100 Subject: [PATCH] Fix tests broken by urlmatch trailing slash change --- tests/unit/config/test_config.py | 4 ++-- tests/unit/config/test_configutils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/config/test_config.py b/tests/unit/config/test_config.py index 095bfa78d..46559bffa 100644 --- a/tests/unit/config/test_config.py +++ b/tests/unit/config/test_config.py @@ -411,10 +411,10 @@ class TestConfig: def test_get_for_url(self, conf): """Test conf.get() with an URL/pattern.""" - pattern = urlmatch.UrlPattern('*://example.com') + pattern = urlmatch.UrlPattern('*://example.com/') name = 'content.javascript.enabled' conf.set_obj(name, False, pattern=pattern) - assert conf.get(name, url=QUrl('https://example.com/')) is True + assert conf.get(name, url=QUrl('https://example.com/')) is False @pytest.mark.parametrize('value', [{}, {'normal': {'a': 'nop'}}]) def test_get_bindings(self, config_stub, conf, value): diff --git a/tests/unit/config/test_configutils.py b/tests/unit/config/test_configutils.py index ef91b13ee..0793b8271 100644 --- a/tests/unit/config/test_configutils.py +++ b/tests/unit/config/test_configutils.py @@ -201,7 +201,7 @@ def test_get_non_matching_fallback_pattern(values, other_pattern): def test_get_equivalent_patterns(empty_values): """With multiple matching pattern, the last added should win.""" pat1 = urlmatch.UrlPattern('https://www.example.com/') - pat2 = urlmatch.UrlPattern('https://www.example.com') + pat2 = urlmatch.UrlPattern('*://www.example.com/') empty_values.add('pat1 value', pat1) empty_values.add('pat2 value', pat2)