Example #1
0
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
Example #2
0
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)
Example #3
0
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
Example #4
0
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)
Example #5
0
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