mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-30 22:54:14 +00:00 
			
		
		
		
	#682: Unify work with output in classic and instant mode
This commit is contained in:
		| @@ -1,18 +1,18 @@ | ||||
| import pytest | ||||
| from thefuck.specific.git import git_support | ||||
| from tests.utils import Command | ||||
| from thefuck.types import Command | ||||
|  | ||||
|  | ||||
| @pytest.mark.parametrize('called, command, stderr', [ | ||||
| @pytest.mark.parametrize('called, command, output', [ | ||||
|     ('git co', 'git checkout', "19:22:36.299340 git.c:282   trace: alias expansion: co => 'checkout'"), | ||||
|     ('git com file', 'git commit --verbose file', | ||||
|      "19:23:25.470911 git.c:282   trace: alias expansion: com => 'commit' '--verbose'")]) | ||||
| def test_git_support(called, command, stderr): | ||||
| def test_git_support(called, command, output): | ||||
|     @git_support | ||||
|     def fn(command): | ||||
|         return command.script | ||||
|  | ||||
|     assert fn(Command(script=called, stderr=stderr)) == command | ||||
|     assert fn(Command(called, output)) == command | ||||
|  | ||||
|  | ||||
| @pytest.mark.parametrize('command, is_git', [ | ||||
| @@ -28,4 +28,4 @@ def test_git_support_match(command, is_git): | ||||
|     def fn(command): | ||||
|         return True | ||||
|  | ||||
|     assert fn(Command(script=command)) == is_git | ||||
|     assert fn(Command(command, '')) == is_git | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import pytest | ||||
| from thefuck.specific.sudo import sudo_support | ||||
| from tests.utils import Command | ||||
| from thefuck.types import Command | ||||
|  | ||||
|  | ||||
| @pytest.mark.parametrize('return_value, command, called, result', [ | ||||
| @@ -13,7 +13,7 @@ from tests.utils import Command | ||||
|     (False, 'ls', 'ls', False)]) | ||||
| def test_sudo_support(return_value, command, called, result): | ||||
|     def fn(command): | ||||
|         assert command == Command(called) | ||||
|         assert command == Command(called, '') | ||||
|         return return_value | ||||
|  | ||||
|     assert sudo_support(fn)(Command(command)) == result | ||||
|     assert sudo_support(fn)(Command(command, '')) == result | ||||
|   | ||||
		Reference in New Issue
	
	Block a user