1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-10-30 14:44:05 +00:00

add git-lfs support (#1056)

* add mistyping support for git lfs

* add the rule

* fix flake8

* flake8

* add to readme

* use fixtures and regex

* get rid of additional matched strings
This commit is contained in:
Connor Martin
2020-06-10 17:20:37 -05:00
committed by GitHub
parent 6975d30818
commit f82176802e
3 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import pytest
from thefuck.rules.git_lfs_mistype import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def mistype_response():
return """
Error: unknown command "evn" for "git-lfs"
Did you mean this?
env
ext
Run 'git-lfs --help' for usage.
"""
def test_match(mistype_response):
assert match(Command('git lfs evn', mistype_response))
err_response = 'bash: git: command not found'
assert not match(Command('git lfs env', err_response))
assert not match(Command('docker lfs env', mistype_response))
def test_get_new_command(mistype_response):
assert (get_new_command(Command('git lfs evn', mistype_response))
== ['git lfs env', 'git lfs ext'])