⚠️ Remove settings param from rules match, get_new_command and side_effect
This commit is contained in:
@@ -9,9 +9,10 @@ from tests.utils import Command
|
||||
"19:23:25.470911 git.c:282 trace: alias expansion: com => 'commit' '--verbose'")])
|
||||
def test_git_support(called, command, stderr):
|
||||
@git_support
|
||||
def fn(command, settings): return command.script
|
||||
def fn(command):
|
||||
return command.script
|
||||
|
||||
assert fn(Command(script=called, stderr=stderr), None) == command
|
||||
assert fn(Command(script=called, stderr=stderr)) == command
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command, is_git', [
|
||||
@@ -24,6 +25,7 @@ def test_git_support(called, command, stderr):
|
||||
('cat hub', False)])
|
||||
def test_git_support_match(command, is_git):
|
||||
@git_support
|
||||
def fn(command, settings): return True
|
||||
def fn(command):
|
||||
return True
|
||||
|
||||
assert fn(Command(script=command), None) == is_git
|
||||
assert fn(Command(script=command)) == is_git
|
||||
|
||||
@@ -13,8 +13,8 @@ from tests.utils import Command
|
||||
(False, 'sudo ls', 'ls', False),
|
||||
(False, 'ls', 'ls', False)])
|
||||
def test_sudo_support(return_value, command, called, result):
|
||||
def fn(command, settings):
|
||||
def fn(command):
|
||||
assert command == Command(called)
|
||||
return return_value
|
||||
|
||||
assert sudo_support(fn)(Command(command), None) == result
|
||||
assert sudo_support(fn)(Command(command)) == result
|
||||
|
||||
Reference in New Issue
Block a user