mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 12:06:04 +00:00
dbc435c040
The rule was in a non-working state. And the tests needed some bit of simplification. Certain degree of repetition is oftentimes a good thing.
21 lines
719 B
Python
21 lines
719 B
Python
from thefuck.types import Command
|
|
from thefuck.rules.git_push_without_commits import get_new_command, match
|
|
|
|
|
|
def test_match():
|
|
script = "git push -u origin master"
|
|
output = "error: src refspec master does not match any\nerror: failed to..."
|
|
assert match(Command(script, output))
|
|
|
|
|
|
def test_not_match():
|
|
script = "git push -u origin master"
|
|
assert not match(Command(script, "Everything up-to-date"))
|
|
|
|
|
|
def test_get_new_command():
|
|
script = "git push -u origin master"
|
|
output = "error: src refspec master does not match any\nerror: failed to..."
|
|
new_command = 'git commit -m "Initial commit" && git push -u origin master'
|
|
assert get_new_command(Command(script, output)) == new_command
|