mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-08 12:53:58 +01:00
#N/A: Fix tests with py.test 4
This commit is contained in:
@@ -3,23 +3,21 @@ from thefuck.rules.git_merge_unrelated import match, get_new_command
|
||||
from thefuck.types import Command
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def output():
|
||||
return 'fatal: refusing to merge unrelated histories'
|
||||
output = 'fatal: refusing to merge unrelated histories'
|
||||
|
||||
|
||||
def test_match(output):
|
||||
def test_match():
|
||||
assert match(Command('git merge test', output))
|
||||
assert not match(Command('git merge master', ''))
|
||||
assert not match(Command('ls', output))
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command, new_command', [
|
||||
(Command('git merge local', output()),
|
||||
(Command('git merge local', output),
|
||||
'git merge local --allow-unrelated-histories'),
|
||||
(Command('git merge -m "test" local', output()),
|
||||
(Command('git merge -m "test" local', output),
|
||||
'git merge -m "test" local --allow-unrelated-histories'),
|
||||
(Command('git merge -m "test local" local', output()),
|
||||
(Command('git merge -m "test local" local', output),
|
||||
'git merge -m "test local" local --allow-unrelated-histories')])
|
||||
def test_get_new_command(command, new_command):
|
||||
assert get_new_command(command) == new_command
|
||||
|
Reference in New Issue
Block a user