mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-30 14:44:05 +00:00
#620: Add support of arguments to fuck, like fuck -y on zsh
This commit is contained in:
26
tests/test_argument_parser.py
Normal file
26
tests/test_argument_parser.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import pytest
|
||||
from thefuck.argument_parser import Parser
|
||||
from thefuck.const import ARGUMENT_PLACEHOLDER
|
||||
|
||||
|
||||
@pytest.mark.parametrize('argv, result', [
|
||||
(['thefuck'], {'alias': None, 'command': [], 'yes': False,
|
||||
'help': False, 'version': False}),
|
||||
(['thefuck', '-a'], {'alias': 'fuck', 'command': [], 'yes': False,
|
||||
'help': False, 'version': False}),
|
||||
(['thefuck', '-a', 'fix'], {'alias': 'fix', 'command': [], 'yes': False,
|
||||
'help': False, 'version': False}),
|
||||
(['thefuck', 'git', 'branch', ARGUMENT_PLACEHOLDER, '-y'],
|
||||
{'alias': None, 'command': ['git', 'branch'], 'yes': True,
|
||||
'help': False, 'version': False}),
|
||||
(['thefuck', 'git', 'branch', '-a', ARGUMENT_PLACEHOLDER, '-y'],
|
||||
{'alias': None, 'command': ['git', 'branch', '-a'], 'yes': True,
|
||||
'help': False, 'version': False}),
|
||||
(['thefuck', ARGUMENT_PLACEHOLDER, '-v'],
|
||||
{'alias': None, 'command': [], 'yes': False, 'help': False,
|
||||
'version': True}),
|
||||
(['thefuck', ARGUMENT_PLACEHOLDER, '--help'],
|
||||
{'alias': None, 'command': [], 'yes': False, 'help': True,
|
||||
'version': False})])
|
||||
def test_parse(argv, result):
|
||||
assert vars(Parser().parse(argv)) == result
|
||||
Reference in New Issue
Block a user