Clean up miscmodels and test_models.
- Split up a long conditional into multiple variables. - Fix a small typo in a related test. - Remove a trailing comma from an argument list.
This commit is contained in:
parent
8dbc368d08
commit
709470fbe6
@ -43,7 +43,7 @@ class CommandCompletionModel(base.BaseCompletionModel):
|
|||||||
include_hidden=False)
|
include_hidden=False)
|
||||||
cat = self.new_category("Commands")
|
cat = self.new_category("Commands")
|
||||||
for (name, desc, misc) in cmdlist:
|
for (name, desc, misc) in cmdlist:
|
||||||
self.new_item(cat, name, desc, misc, )
|
self.new_item(cat, name, desc, misc)
|
||||||
|
|
||||||
|
|
||||||
class HelpCompletionModel(base.BaseCompletionModel):
|
class HelpCompletionModel(base.BaseCompletionModel):
|
||||||
@ -275,9 +275,9 @@ def _get_cmd_completions(include_hidden, include_aliases, prefix=''):
|
|||||||
cmdlist = []
|
cmdlist = []
|
||||||
cmd_to_keys = objreg.get('key-config').get_reverse_bindings_for('normal')
|
cmd_to_keys = objreg.get('key-config').get_reverse_bindings_for('normal')
|
||||||
for obj in set(cmdutils.cmd_dict.values()):
|
for obj in set(cmdutils.cmd_dict.values()):
|
||||||
if ((not obj.debug or objreg.get('args').debug) and
|
hide_debug = obj.debug and not objreg.get('args').debug
|
||||||
not obj.deprecated and
|
hide_hidden = obj.hide and not include_hidden
|
||||||
(include_hidden or not obj.hide)):
|
if not (hide_debug or hide_hidden or obj.deprecated):
|
||||||
bindings = ', '.join(cmd_to_keys[obj.name])
|
bindings = ', '.join(cmd_to_keys[obj.name])
|
||||||
cmdlist.append((prefix + obj.name, obj.desc, bindings))
|
cmdlist.append((prefix + obj.name, obj.desc, bindings))
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ def test_setting_value_completion(qtmodeltester, monkeypatch, stubs,
|
|||||||
|
|
||||||
def test_bind_completion(qtmodeltester, monkeypatch, stubs, config_stub,
|
def test_bind_completion(qtmodeltester, monkeypatch, stubs, config_stub,
|
||||||
key_config_stub):
|
key_config_stub):
|
||||||
"""Test the results of command completion.
|
"""Test the results of keybinding command completion.
|
||||||
|
|
||||||
Validates that:
|
Validates that:
|
||||||
- only non-hidden and non-deprecated commands are included
|
- only non-hidden and non-deprecated commands are included
|
||||||
|
Loading…
Reference in New Issue
Block a user