1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-09-18 19:22:32 +01:00

#682: Use our own shell logger, fix experimental instant mode on macos

This commit is contained in:
Vladimir Iakovlev
2017-10-08 16:17:41 +02:00
parent edac010a7b
commit d2c70bd8b8
6 changed files with 85 additions and 4 deletions

View File

@@ -7,7 +7,8 @@ def _args(**override):
args = {'alias': None, 'command': [], 'yes': False,
'help': False, 'version': False, 'debug': False,
'force_command': None, 'repeat': False,
'enable_experimental_instant_mode': False}
'enable_experimental_instant_mode': False,
'shell_logger': None}
args.update(override)
return args
@@ -27,6 +28,9 @@ def _args(**override):
(['thefuck', 'git', 'branch', '-a', ARGUMENT_PLACEHOLDER, '-y', '-d'],
_args(command=['git', 'branch', '-a'], yes=True, debug=True)),
(['thefuck', 'git', 'branch', '-a', ARGUMENT_PLACEHOLDER, '-r', '-d'],
_args(command=['git', 'branch', '-a'], repeat=True, debug=True))])
_args(command=['git', 'branch', '-a'], repeat=True, debug=True)),
(['thefuck', '-l', '/tmp/log'], _args(shell_logger='/tmp/log')),
(['thefuck', '--shell-logger', '/tmp/log'],
_args(shell_logger='/tmp/log'))])
def test_parse(argv, result):
assert vars(Parser().parse(argv)) == result