From 135fb042daaf378d73bc50343dd551553efde09a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 10 Jul 2017 18:04:39 +0200 Subject: [PATCH] Make settings from qute://settings persistent --- qutebrowser/browser/qutescheme.py | 3 +-- tests/end2end/test_invocations.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index adf9f49b7..1ef00150e 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -457,7 +457,7 @@ def _qute_settings_set(url): return 'text/html', b'error: ' + msg.encode('utf-8') try: - config.instance.set_str(option, value) + config.instance.set_str(option, value, save_yaml=True) return 'text/html', b'ok' except configexc.Error as e: message.error(str(e)) @@ -467,7 +467,6 @@ def _qute_settings_set(url): @add_handler('settings') def qute_settings(url): """Handler for qute://settings. View/change qute configuration.""" - # FIXME:conf add a test for this if url.path() == '/set': return _qute_settings_set(url) diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py index 220b36c2b..63b0b5ac3 100644 --- a/tests/end2end/test_invocations.py +++ b/tests/end2end/test_invocations.py @@ -306,3 +306,17 @@ def test_loading_empty_session(tmpdir, request, quteproc_new): quteproc_new.send_cmd(':quit') quteproc_new.wait_for_quit() + + +def test_qute_settings_persistence(short_tmpdir, request, quteproc_new): + """Make sure settings from qute://settings are persistent.""" + args = _base_args(request.config) + ['--basedir', str(short_tmpdir)] + quteproc_new.start(args) + quteproc_new.open_path('qute://settings/set?option=ignore_case&value=always') + assert quteproc_new.get_setting('ignore_case') == 'always' + + quteproc_new.send_cmd(':quit') + quteproc_new.wait_for_quit() + + quteproc_new.start(args) + assert quteproc_new.get_setting('ignore_case') == 'always'