Fix test for :debug-log-level with invalid level

Since we're getting dictionary keys in choices=..., we need to sort them
so we get a consistent message.
This commit is contained in:
Florian Bruhin 2016-08-19 14:57:21 +02:00
parent 37758131f5
commit 75c3b1a9f8
2 changed files with 4 additions and 3 deletions

View File

@ -259,8 +259,9 @@ def window_only(current_win_id):
@cmdutils.register(debug=True)
@cmdutils.argument('level', choices=[level.lower()
for level in log.LOG_LEVELS])
@cmdutils.argument('level', choices=sorted(
(level.lower() for level in log.LOG_LEVELS),
key=lambda e: log.LOG_LEVELS[e.upper()]))
def debug_log_level(level: str):
"""Change the log level for console logging.

View File

@ -610,4 +610,4 @@ Feature: Various utility commands.
Scenario: Using debug-log-level with invalid level
When I run :debug-log-level hello
Then the error "Invalid value hello - expected one of: debug, error, vdebug, info, warning, critical" should be shown
Then the error "level: Invalid value hello - expected one of: vdebug, debug, info, warning, error, critical" should be shown