summaryrefslogtreecommitdiff
path: root/tests/unit/completion/test_models.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2018-10-11 14:07:13 +0200
committerFlorian Bruhin <me@the-compiler.org>2018-10-11 14:07:13 +0200
commitee60159c165363878af352ef0163e32b8051b0c7 (patch)
treefe87d766b19984ccbf42cb860b89406c1422385d /tests/unit/completion/test_models.py
parent3e39fc0e69bc0d19aa1e204625d8f1d4ee81f85b (diff)
downloadqutebrowser-ee60159c165363878af352ef0163e32b8051b0c7.tar.gz
qutebrowser-ee60159c165363878af352ef0163e32b8051b0c7.zip
Add missing tests for configmodel
Diffstat (limited to 'tests/unit/completion/test_models.py')
-rw-r--r--tests/unit/completion/test_models.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/unit/completion/test_models.py b/tests/unit/completion/test_models.py
index c820147e5..28265689c 100644
--- a/tests/unit/completion/test_models.py
+++ b/tests/unit/completion/test_models.py
@@ -858,6 +858,40 @@ def test_setting_option_completion(qtmodeltester, config_stub,
})
+def test_setting_dict_option_completion(qtmodeltester, config_stub,
+ configdata_stub, info):
+ model = configmodel.dict_option(info=info)
+ model.set_pattern('')
+ qtmodeltester.check(model)
+
+ _check_completions(model, {
+ "Dict options": [
+ ('aliases', 'Aliases for commands.', '{"q": "quit"}'),
+ ('bindings.commands', 'Default keybindings', (
+ '{"normal": {"<Ctrl+q>": "quit", "I": "invalid", '
+ '"ZQ": "quit", "d": "scroll down"}}')),
+ ('url.searchengines', 'searchengines list',
+ '{"DEFAULT": "https://duckduckgo.com/?q={}", '
+ '"google": "https://google.com/?q={}"}'),
+ ]
+ })
+
+
+def test_setting_list_option_completion(qtmodeltester, config_stub,
+ configdata_stub, info):
+ model = configmodel.list_option(info=info)
+ model.set_pattern('')
+ qtmodeltester.check(model)
+
+ _check_completions(model, {
+ "List options": [
+ ('completion.open_categories', 'Which categories to show (in '
+ 'which order) in the :open completion.',
+ '["searchengines", "quickmarks", "bookmarks", "history"]'),
+ ]
+ })
+
+
def test_setting_customized_option_completion(qtmodeltester, config_stub,
configdata_stub, info):
info.config.set_obj('aliases', {'foo': 'nop'})