1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-10-31 07:04:12 +00:00

Allow rules to correct commands that time out

This commit is contained in:
mcarton
2015-07-25 23:04:08 +02:00
parent bfa3c905a3
commit 71bb1994c3
4 changed files with 33 additions and 20 deletions

View File

@@ -14,7 +14,8 @@ def test_load_rule(mocker):
return_value=Mock(match=match,
get_new_command=get_new_command,
enabled_by_default=True,
priority=900))
priority=900,
requires_output=True))
assert main.load_rule(Path('/rules/bash.py')) \
== Rule('bash', match, get_new_command, priority=900)
load_source.assert_called_once_with('bash', '/rules/bash.py')

View File

@@ -10,7 +10,8 @@ def Rule(name='', match=lambda *_: True,
get_new_command=lambda *_: '',
enabled_by_default=True,
side_effect=None,
priority=DEFAULT_PRIORITY):
priority=DEFAULT_PRIORITY,
requires_output=True):
return types.Rule(name, match, get_new_command,
enabled_by_default, side_effect,
priority)
priority, requires_output)