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:
Ryan Roden-Corrent 2016-08-04 06:30:24 -04:00
parent 8dbc368d08
commit 709470fbe6
2 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@ class CommandCompletionModel(base.BaseCompletionModel):
include_hidden=False)
cat = self.new_category("Commands")
for (name, desc, misc) in cmdlist:
self.new_item(cat, name, desc, misc, )
self.new_item(cat, name, desc, misc)
class HelpCompletionModel(base.BaseCompletionModel):
@ -275,9 +275,9 @@ def _get_cmd_completions(include_hidden, include_aliases, prefix=''):
cmdlist = []
cmd_to_keys = objreg.get('key-config').get_reverse_bindings_for('normal')
for obj in set(cmdutils.cmd_dict.values()):
if ((not obj.debug or objreg.get('args').debug) and
not obj.deprecated and
(include_hidden or not obj.hide)):
hide_debug = obj.debug and not objreg.get('args').debug
hide_hidden = obj.hide and not include_hidden
if not (hide_debug or hide_hidden or obj.deprecated):
bindings = ', '.join(cmd_to_keys[obj.name])
cmdlist.append((prefix + obj.name, obj.desc, bindings))

View File

@ -453,7 +453,7 @@ def test_setting_value_completion(qtmodeltester, monkeypatch, stubs,
def test_bind_completion(qtmodeltester, monkeypatch, stubs, config_stub,
key_config_stub):
"""Test the results of command completion.
"""Test the results of keybinding command completion.
Validates that:
- only non-hidden and non-deprecated commands are included