summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2018-03-06 13:26:22 +0100
committerFlorian Bruhin <git@the-compiler.org>2018-03-06 13:26:22 +0100
commitdb7ccb04341afb1de5e86b7fd99be97cc7ea8bee (patch)
treea1ac289ee94c7ed2e8aa437c4732be3a3d871cb0
parente1a03929e34d47e1ca4351364defd03c994fd3bc (diff)
downloadqutebrowser-db7ccb04341afb1de5e86b7fd99be97cc7ea8bee.tar.gz
qutebrowser-db7ccb04341afb1de5e86b7fd99be97cc7ea8bee.zip
Update config tests for pattern changes
-rw-r--r--tests/unit/config/test_configcommands.py7
-rw-r--r--tests/unit/config/test_configfiles.py11
2 files changed, 10 insertions, 8 deletions
diff --git a/tests/unit/config/test_configcommands.py b/tests/unit/config/test_configcommands.py
index 4a09b5be2..80328a22d 100644
--- a/tests/unit/config/test_configcommands.py
+++ b/tests/unit/config/test_configcommands.py
@@ -107,9 +107,10 @@ class TestSet:
monkeypatch.setattr(objects, 'backend', usertypes.Backend.QtWebKit)
option = 'content.javascript.enabled'
- with pytest.raises(cmdexc.CommandError,
- match='Error while parsing :/: No scheme given'):
- commands.set(0, option, 'false', pattern=':/')
+ with pytest.raises(
+ cmdexc.CommandError,
+ match='Error while parsing http://: Pattern without host'):
+ commands.set(0, option, 'false', pattern='http://')
def test_set_no_pattern(self, monkeypatch, commands):
"""Run ':set --pattern=*://* colors.statusbar.normal.bg #abcdef.
diff --git a/tests/unit/config/test_configfiles.py b/tests/unit/config/test_configfiles.py
index 186b3cd55..d3b3f5726 100644
--- a/tests/unit/config/test_configfiles.py
+++ b/tests/unit/config/test_configfiles.py
@@ -301,7 +301,8 @@ class TestYaml:
('settings: {"content.images": 42}\nconfig_version: 2',
"While parsing 'content.images'", "value is not a dict"),
('settings: {"content.images": {"https://": true}}\nconfig_version: 2',
- "While parsing pattern 'https://' for 'content.images'", "Pattern without host"),
+ "While parsing pattern 'https://' for 'content.images'",
+ "Pattern without host"),
('settings: {"content.images": {true: true}}\nconfig_version: 2',
"While parsing 'content.images'", "pattern is not of type string"),
])
@@ -737,11 +738,11 @@ class TestConfigPy:
assert str(error.exception) == expected
@pytest.mark.parametrize('line, text', [
- ('config.get("content.images", "://")',
+ ('config.get("content.images", "http://")',
"While getting 'content.images' and parsing pattern"),
- ('config.set("content.images", False, "://")',
+ ('config.set("content.images", False, "http://")',
"While setting 'content.images' and parsing pattern"),
- ('with config.pattern("://"): pass',
+ ('with config.pattern("http://"): pass',
"Unhandled exception"),
])
def test_invalid_pattern(self, confpy, line, text):
@@ -750,7 +751,7 @@ class TestConfigPy:
assert error.text == text
assert isinstance(error.exception, urlmatch.ParseError)
- assert str(error.exception) == "No scheme given"
+ assert str(error.exception) == "Pattern without host"
def test_multiple_errors(self, confpy):
confpy.write("c.foo = 42", "config.set('foo', 42)", "1/0")