# Path: revolver/contextmanager.py
# def sudo(username=None, login=False):
# def unpatched_state():
# 
# Path: revolver/decorator.py
# def sudo(func):
#     def wrapper(*args, **kwargs):
# def multiargs(func):
#     def wrapper(*args, **kwargs):
# def inject_use_sudo(func):
#     def inject_wrapper(*args, **kwargs):
# 
# Path: revolver/core.py
# VERSION = '0.0.5'
# def put(*args, **kwargs):
# def run(*args, **kwargs):
# def sudo(*args, **kwargs):


import fabric
from revolver import contextmanager as ctx
from revolver import decorator, core
    stack = []

    def dummy(*args, **kwargs):
        stack.append((args, kwargs))

    decorator.multiargs(dummy)()
    assert stack == [((), {})]


def test_multiargs_no_list():
    stack = []

    def dummy(*args, **kwargs):
        stack.append((args, kwargs))

    decorator.multiargs(dummy)("foo", bar="baz")
    assert stack == [(("foo",), {"bar": "baz"})]


def _sudo_dummy(sudo=None):
    return sudo


def test_sudo_dummy():
    assert _sudo_dummy() is None
    assert _sudo_dummy(True)
    assert not _sudo_dummy(False)


def test_inject_sudo_with_forced_sudo():

# Path: revolver/contextmanager.py
# def sudo(username=None, login=False):
# def unpatched_state():
# 
# Path: revolver/decorator.py
# def sudo(func):
#     def wrapper(*args, **kwargs):
# def multiargs(func):
#     def wrapper(*args, **kwargs):
# def inject_use_sudo(func):
#     def inject_wrapper(*args, **kwargs):
# 
# Path: revolver/core.py
# VERSION = '0.0.5'
# def put(*args, **kwargs):
# def run(*args, **kwargs):
# def sudo(*args, **kwargs):


# Path: revolver/test/decorator_test.py
import fabric
from revolver import contextmanager as ctx
from revolver import decorator, core

    stack = []

    def dummy(*args, **kwargs):
        stack.append((args, kwargs))

    decorator.multiargs(dummy)()
    assert stack == [((), {})]


def test_multiargs_no_list():
    stack = []

    def dummy(*args, **kwargs):
        stack.append((args, kwargs))

    decorator.multiargs(dummy)("foo", bar="baz")
    assert stack == [(("foo",), {"bar": "baz"})]


def _sudo_dummy(sudo=None):
    return sudo


def test_sudo_dummy():
    assert _sudo_dummy() is None
    assert _sudo_dummy(True)
    assert not _sudo_dummy(False)


def test_inject_sudo_with_forced_sudo():

    with ctx.sudo():