2016-12-11 12:37:09 -05:00
|
|
|
import pytest
|
|
|
|
from thefuck.rules.git_stash_pop import match, get_new_command
|
2017-08-31 17:58:56 +02:00
|
|
|
from thefuck.types import Command
|
2016-12-11 12:37:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
2017-08-31 17:58:56 +02:00
|
|
|
def output():
|
2016-12-11 12:37:09 -05:00
|
|
|
return '''error: Your local changes to the following files would be overwritten by merge:'''
|
|
|
|
|
|
|
|
|
2017-08-31 17:58:56 +02:00
|
|
|
def test_match(output):
|
|
|
|
assert match(Command('git stash pop', output))
|
|
|
|
assert not match(Command('git stash', ''))
|
2016-12-11 12:37:09 -05:00
|
|
|
|
|
|
|
|
2017-08-31 17:58:56 +02:00
|
|
|
def test_get_new_command(output):
|
|
|
|
assert (get_new_command(Command('git stash pop', output))
|
2017-03-21 20:12:15 -04:00
|
|
|
== "git add --update && git stash pop && git reset .")
|