mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-30 06:34:09 +00:00
Squashed commit of the following:
commit 6919161e77a39b9bd59ca54eac44b956cd3ae1dc Author: Vladimir Iakovlev <nvbn.rm@gmail.com> Date: Tue May 22 19:01:33 2018 +0200 #810: Fix code style commit ebbb31a3227ce32ba5288e96c0c16a3d334c45d6 Merge:2df1a5aa2799adAuthor: Vladimir Iakovlev <nvbn.rm@gmail.com> Date: Tue May 22 18:59:56 2018 +0200 Merge branch 'feature/long-form-help' of https://github.com/jakewarren/thefuck into jakewarren-feature/long-form-help commita2799ad098Author: Jake Warren <jakewarren@users.noreply.github.com> Date: Mon May 7 14:12:57 2018 -0500 Add new `long_form_help` rule
This commit is contained in:
22
tests/rules/test_long_form_help.py
Normal file
22
tests/rules/test_long_form_help.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import pytest
|
||||
from thefuck.rules.long_form_help import match, get_new_command
|
||||
from thefuck.types import Command
|
||||
|
||||
|
||||
@pytest.mark.parametrize('output', [
|
||||
'Try \'grep --help\' for more information.'])
|
||||
def test_match(output):
|
||||
assert match(Command('grep -h', output))
|
||||
|
||||
|
||||
def test_not_match():
|
||||
assert not match(Command('', ''))
|
||||
|
||||
|
||||
@pytest.mark.parametrize('before, after', [
|
||||
('grep -h', 'grep --help'),
|
||||
('tar -h', 'tar --help'),
|
||||
('docker run -h', 'docker run --help'),
|
||||
('cut -h', 'cut --help')])
|
||||
def test_get_new_command(before, after):
|
||||
assert get_new_command(Command(before, '')) == after
|
||||
Reference in New Issue
Block a user