mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-10 13:54:04 +01:00
Use decorator library
This commit is contained in:
@@ -13,6 +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):
|
||||
fn = Mock(return_value=return_value, __name__='')
|
||||
def fn(command, settings):
|
||||
assert command == Command(called)
|
||||
return return_value
|
||||
|
||||
assert sudo_support(fn)(Command(command), None) == result
|
||||
fn.assert_called_once_with(Command(called), None)
|
||||
|
Reference in New Issue
Block a user