summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-05-30 10:57:41 +0200
committerFlorian Bruhin <me@the-compiler.org>2021-05-30 12:56:41 +0200
commit06674ca8e752496c17032e62f428a47c676892df (patch)
tree6802cda7492620d4f902e36dc20d37bbf174abec /tests
parent997f7cd9a8442acafb7f589793e7182110a0d720 (diff)
downloadqutebrowser-06674ca8e752496c17032e62f428a47c676892df.tar.gz
qutebrowser-06674ca8e752496c17032e62f428a47c676892df.zip
Validate encoding for header settings
Also needed to add encoding check support to FormatString. (cherry picked from commit 996487c43e4fcc265b541f9eca1e7930e3c5cf05)
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/config/test_configtypes.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unit/config/test_configtypes.py b/tests/unit/config/test_configtypes.py
index 3e1d15099..66b152937 100644
--- a/tests/unit/config/test_configtypes.py
+++ b/tests/unit/config/test_configtypes.py
@@ -1839,6 +1839,11 @@ class TestFormatString:
with pytest.raises(configexc.ValidationError):
typ.to_py(val)
+ def test_invalid_encoding(self, klass):
+ typ = klass(fields=[], encoding='ascii')
+ with pytest.raises(configexc.ValidationError):
+ typ.to_py('fooƤbar')
+
@pytest.mark.parametrize('value', [
None,
['one', 'two'],