def test_sudo_support(return_value, command, called, result): def fn(command): assert command == Command(called) return return_value assert sudo_support(fn)(Command(command)) == result
def test_sudo_support(return_value, command, called, result): fn = Mock(return_value=return_value, __name__='') assert sudo_support(fn)(Command(command), None) == result fn.assert_called_once_with(Command(called), None)
def test_sudo_support(return_value, command, called, result): def fn(command, settings): assert command == Command(called) return return_value assert sudo_support(fn)(Command(command), None) == result
def test_sudo_support(return_value, command, called, result): def fn(command): assert command == Command(called, '') return return_value assert sudo_support(fn)(Command(command, '')) == result