# Path: revolver/service.py
# def add_upstart(name, content):
# def command(name, command):
# def start(name):
# def stop(name):
# def restart(name):
# def reload(name):
# def is_running(name):


from fudge import patch
from revolver import service
import fabric
# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, with_statement




@patch("revolver.core.sudo")
def test_is_running(sudo):
    command = "/etc/init.d/foo status"
    result = fabric.operations._AttributeList("")
    result.succeeded = "succeeded"

    sudo.expects_call().with_args(command).returns(result)

# Path: revolver/service.py
# def add_upstart(name, content):
# def command(name, command):
# def start(name):
# def stop(name):
# def restart(name):
# def reload(name):
# def is_running(name):


# Path: revolver/test/service_test.py
from fudge import patch
from revolver import service
import fabric

# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, with_statement




@patch("revolver.core.sudo")
def test_is_running(sudo):
    command = "/etc/init.d/foo status"
    result = fabric.operations._AttributeList("")
    result.succeeded = "succeeded"

    sudo.expects_call().with_args(command).returns(result)

    assert service.is_running("foo") == "succeeded"