mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 01:28:56 +00:00
added test and readme
This commit is contained in:
parent
4b67eba2ea
commit
a633fb5366
@ -209,6 +209,7 @@ following rules are enabled by default:
|
|||||||
* `git_fix_stash` – fixes `git stash` commands (misspelled subcommand and missing `save`);
|
* `git_fix_stash` – fixes `git stash` commands (misspelled subcommand and missing `save`);
|
||||||
* `git_flag_after_filename` – fixes `fatal: bad flag '...' after filename`
|
* `git_flag_after_filename` – fixes `fatal: bad flag '...' after filename`
|
||||||
* `git_help_aliased` – fixes `git help <alias>` commands replacing <alias> with the aliased command;
|
* `git_help_aliased` – fixes `git help <alias>` commands replacing <alias> with the aliased command;
|
||||||
|
* `git_log` – replaces `git lock` command with `git log`;
|
||||||
* `git_merge` – adds remote to branch names;
|
* `git_merge` – adds remote to branch names;
|
||||||
* `git_merge_unrelated` – adds `--allow-unrelated-histories` when required
|
* `git_merge_unrelated` – adds `--allow-unrelated-histories` when required
|
||||||
* `git_not_command` – fixes wrong git commands like `git brnch`;
|
* `git_not_command` – fixes wrong git commands like `git brnch`;
|
||||||
|
25
tests/rules/test_git_log.py
Normal file
25
tests/rules/test_git_log.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import pytest
|
||||||
|
from thefuck.rules.git_log import match, get_new_command
|
||||||
|
from thefuck.types import Command
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('script, output', [
|
||||||
|
('git lock', 'git: \'lock\' is not a git command.'),
|
||||||
|
('git lock --help', 'git: \'lock\' is not a git command.')])
|
||||||
|
def test_match(output, script):
|
||||||
|
assert match(Command(script, output))
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('script', [
|
||||||
|
'git branch foo',
|
||||||
|
'git checkout feature/test_commit',
|
||||||
|
'git push'])
|
||||||
|
def test_not_match(script):
|
||||||
|
assert not match(Command(script, ''))
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('script, output', [
|
||||||
|
('git lock', 'git log'),
|
||||||
|
('git lock --help', 'git log --help')])
|
||||||
|
def test_get_new_command(script, output):
|
||||||
|
assert get_new_command(Command(script, '')) == output
|
Loading…
x
Reference in New Issue
Block a user