diff options
author | Vasilij Schneidermann <mail@vasilij.de> | 2018-08-31 20:36:22 +0200 |
---|---|---|
committer | Vasilij Schneidermann <mail@vasilij.de> | 2018-08-31 21:34:42 +0200 |
commit | 3fa6d948935d7e8a11db91c9bfc8f90cfd31acb1 (patch) | |
tree | 486f09b772ccb357a5eda1baf7c2d49b66cc601b /tests/unit/config/test_configcommands.py | |
parent | b7b3473f74db8b99007a0acf1a14fc702c216e44 (diff) | |
download | qutebrowser-3fa6d948935d7e8a11db91c9bfc8f90cfd31acb1.tar.gz qutebrowser-3fa6d948935d7e8a11db91c9bfc8f90cfd31acb1.zip |
Display value when calling :set without a value
This change brings Qutebrowser closer to Vim's behavior of `:set
foo?` *and* `:set foo` displaying the current value of `foo`.
Diffstat (limited to 'tests/unit/config/test_configcommands.py')
-rw-r--r-- | tests/unit/config/test_configcommands.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/tests/unit/config/test_configcommands.py b/tests/unit/config/test_configcommands.py index 77097d851..9da480b75 100644 --- a/tests/unit/config/test_configcommands.py +++ b/tests/unit/config/test_configcommands.py @@ -61,13 +61,14 @@ class TestSet: commands.set(win_id=0) assert tabbed_browser_stubs[0].opened_url == QUrl('qute://settings') - def test_get(self, config_stub, commands, message_mock): - """Run ':set url.auto_search?'. + @pytest.mark.parametrize('option', ['url.auto_search?', 'url.auto_search']) + def test_get(self, config_stub, commands, message_mock, option): + """Run ':set url.auto_search?' / ':set url.auto_search?'. Should show the value. """ config_stub.val.url.auto_search = 'never' - commands.set(win_id=0, option='url.auto_search?') + commands.set(win_id=0, option=option) msg = message_mock.getmsg(usertypes.MessageLevel.info) assert msg.text == 'url.auto_search = never' @@ -183,17 +184,13 @@ class TestSet: "not available with the QtWebEngine backend!"): commands.set(0, 'hints.find_implementation', 'javascript') - @pytest.mark.parametrize('option', ['?', 'url.auto_search']) - def test_empty(self, commands, option): - """Run ':set ?' / ':set url.auto_search'. - - Should show an error. + def test_empty(self, commands): + """Run ':set ?'. + Should show an error. See https://github.com/qutebrowser/qutebrowser/issues/1109 """ - with pytest.raises(cmdexc.CommandError, - match="The following arguments are required: " - "value"): - commands.set(win_id=0, option=option) + with pytest.raises(cmdexc.CommandError, match="No option '?'"): + commands.set(win_id=0, option='?') def test_toggle(self, commands): """Try toggling a value. |