mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-03 17:28:58 +00:00
add tests for upper_to_lowercase rule
This commit is contained in:
parent
9680c84848
commit
8b2b3d7e4f
47
tests/rules/test_upper_to_lowercase.py
Normal file
47
tests/rules/test_upper_to_lowercase.py
Normal file
@ -0,0 +1,47 @@
|
||||
import pytest
|
||||
|
||||
from thefuck.rules.upper_to_lowercase import match, get_new_command
|
||||
from thefuck.types import Command
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"script, output",
|
||||
[
|
||||
("LS", ""),
|
||||
("CD THEFUCK", ""),
|
||||
("CAT README.MD", ""),
|
||||
("MV TESTS TESTING", ""),
|
||||
("GIT ADD .", ""),
|
||||
],
|
||||
)
|
||||
def test_match(script, output):
|
||||
assert match(Command(script, output))
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"script, output",
|
||||
[
|
||||
("ls", ""),
|
||||
("cd thefuck", ""),
|
||||
("cat README.md", ""),
|
||||
("mv tests testing", ""),
|
||||
("git add .", ""),
|
||||
],
|
||||
)
|
||||
def test_not_match(script, output):
|
||||
assert not match(Command(script, output))
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"script, output, new_command",
|
||||
[
|
||||
("LS", "", "ls"),
|
||||
("CD THEFUCK", "", "cd thefuck"),
|
||||
("CAT README.MD", "", "cat readme.md"),
|
||||
("MV TESTS TESTING", "", "mv tests testing"),
|
||||
("GIT ADD .", "", "git add ."),
|
||||
],
|
||||
)
|
||||
def test_get_new_command(script, output, new_command):
|
||||
assert get_new_command(Command(script, output)) == new_command
|
Loading…
x
Reference in New Issue
Block a user