1
0
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:
nvbn
2015-08-27 16:52:26 +03:00
parent 0c283ff2b8
commit ebe53f0d18
5 changed files with 52 additions and 61 deletions

View File

@@ -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)