2015-06-02 12:05:47 +08:00
|
|
|
import pytest
|
|
|
|
from thefuck.rules.go_run import match, get_new_command
|
|
|
|
from tests.utils import Command
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize('command', [
|
2015-08-17 13:44:15 +02:00
|
|
|
Command(script='go run foo'),
|
2015-06-26 14:08:25 +02:00
|
|
|
Command(script='go run bar')])
|
2015-06-02 12:05:47 +08:00
|
|
|
def test_match(command):
|
2015-09-07 13:00:29 +03:00
|
|
|
assert match(command)
|
2015-06-02 12:05:47 +08:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize('command, new_command', [
|
2015-06-26 14:08:25 +02:00
|
|
|
(Command('go run foo'), 'go run foo.go'),
|
|
|
|
(Command('go run bar'), 'go run bar.go')])
|
2015-06-02 12:05:47 +08:00
|
|
|
def test_get_new_command(command, new_command):
|
2015-09-07 13:00:29 +03:00
|
|
|
assert get_new_command(command) == new_command
|