diff options
author | Ander Punnar <ander@kvlt.ee> | 2021-04-13 22:27:53 +0300 |
---|---|---|
committer | Ander Punnar <ander@kvlt.ee> | 2021-04-13 22:27:53 +0300 |
commit | 0fe9520042f6ad46fbc55a3b92793c85c13e5b7c (patch) | |
tree | 50e21a055bdba4a7e5aca8b93007f62f5c012c15 /tests | |
parent | 26b84e1c9502d4178c0d0dbcf07a8f8eca8606cb (diff) | |
parent | dacaefaf38bd854d95b4ee10f4c5d563bbcb7240 (diff) | |
download | qutebrowser-0fe9520042f6ad46fbc55a3b92793c85c13e5b7c.tar.gz qutebrowser-0fe9520042f6ad46fbc55a3b92793c85c13e5b7c.zip |
Merge remote-tracking branch 'origin/master' into 4nd3r/hostblock_subdomains
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/config/test_configtypes.py | 18 | ||||
-rw-r--r-- | tests/unit/javascript/test_js_quirks.py | 3 |
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/unit/config/test_configtypes.py b/tests/unit/config/test_configtypes.py index 28c52a1e0..3e1d15099 100644 --- a/tests/unit/config/test_configtypes.py +++ b/tests/unit/config/test_configtypes.py @@ -2117,6 +2117,24 @@ class TestUrlPattern: klass().to_py('http://') +class TestStatusbarWidget: + + @pytest.fixture + def klass(self): + return configtypes.StatusbarWidget + + @pytest.mark.parametrize('value', ['text:bar', 'foo']) + def test_validate_valid_values(self, klass, value): + widget = klass(valid_values=configtypes.ValidValues('foo')) + assert widget.to_py(value) == value + + @pytest.mark.parametrize('value', ['text', 'foo:bar']) + def test_validate_invalid_values(self, klass, value): + widget = klass(valid_values=configtypes.ValidValues('foo')) + with pytest.raises(configexc.ValidationError): + widget.to_py(value) + + @pytest.mark.parametrize('first, second, equal', [ (re.compile('foo'), RegexEq('foo'), True), (RegexEq('bar'), re.compile('bar'), True), diff --git a/tests/unit/javascript/test_js_quirks.py b/tests/unit/javascript/test_js_quirks.py index b906aa17c..7036dcfc9 100644 --- a/tests/unit/javascript/test_js_quirks.py +++ b/tests/unit/javascript/test_js_quirks.py @@ -62,7 +62,8 @@ from qutebrowser.utils import usertypes id='object-fromentries', ), ]) -def test_js_quirks(js_tester_webengine, base_url, source, expected): +def test_js_quirks(config_stub, js_tester_webengine, base_url, source, expected): + config_stub.val.content.site_specific_quirks.skip = [] js_tester_webengine.tab._scripts._inject_site_specific_quirks() js_tester_webengine.load('base.html', base_url=base_url) js_tester_webengine.run(source, expected, world=usertypes.JsWorld.main) |