diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-04-04 13:26:25 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-04-04 13:26:25 +0200 |
commit | e41bd42a74506272dccd27a13fd846dc53e0ac06 (patch) | |
tree | ca4a9a0fd6c93a7df16173fd487a6a7a7e9b12c1 /tests | |
parent | a8d5ce13e8dd3e996d839d3bb80d2f391ff37100 (diff) | |
download | qutebrowser-e41bd42a74506272dccd27a13fd846dc53e0ac06.tar.gz qutebrowser-e41bd42a74506272dccd27a13fd846dc53e0ac06.zip |
Show error when using :config-unset with uncustomized setting
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/config/test_configcommands.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/config/test_configcommands.py b/tests/unit/config/test_configcommands.py index 6aa5d3c11..0375503e8 100644 --- a/tests/unit/config/test_configcommands.py +++ b/tests/unit/config/test_configcommands.py @@ -460,6 +460,10 @@ class TestUnsetAndClear: with pytest.raises(cmdutils.CommandError, match="No option 'tabs'"): commands.config_unset('tabs') + def test_unset_uncustomized(self, commands): + with pytest.raises(cmdutils.CommandError, match="tabs.show is not customized"): + commands.config_unset('tabs.show') + @pytest.mark.parametrize('set_global', [True, False]) def test_unset_pattern(self, commands, config_stub, set_global): name = 'content.javascript.enabled' @@ -479,6 +483,17 @@ class TestUnsetAndClear: assert config_stub.get_obj(name, url=url) == global_value assert config_stub.get_obj(name, url=url, fallback=False) == usertypes.UNSET + def test_unset_uncustomized_pattern(self, commands, config_stub): + name = 'content.javascript.enabled' + pattern = 'example.com' + + config_stub.set_obj(name, False) + with pytest.raises( + cmdutils.CommandError, + match=f"{name} is not customized for {pattern}", + ): + commands.config_unset(name, pattern=pattern) + @pytest.mark.parametrize('save', [True, False]) def test_clear(self, commands, config_stub, yaml_value, save): name = 'tabs.show' |