# Path: revolver/server.py
# def timezone(zone='UTC'):
# def version():
# def codename():
# 
# Path: revolver/test/utils.py
# def run_result(stdout="", stderr="", return_code=0):
#     result = fabric.operations._AttributeString(stdout)
#     result.stderr = stderr
#     result.return_code = return_code
#     result.failed = return_code != 0
#     result.succeeded = return_code == 0
#     return result


from fudge import patch
from revolver import server
from .utils import run_result
import cuisine
# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, with_statement





def test_revolver_is_just_a_wrapper():
    assert server.uuid == cuisine.system_uuid


@patch("revolver.file.copy")
def test_timezone_default(copy):
    copy.expects_call().with_args("/usr/share/zoneinfo/UTC", "/etc/localtime")
    server.timezone()


@patch("revolver.file.copy")
def test_timezone(copy):
    copy.expects_call().with_args("/usr/share/zoneinfo/FOO", "/etc/localtime")
    server.timezone("FOO")


@patch("revolver.core.run")
def test_version(run):
    (run.expects_call()
        .with_args("lsb_release --release --short")

# Path: revolver/server.py
# def timezone(zone='UTC'):
# def version():
# def codename():
# 
# Path: revolver/test/utils.py
# def run_result(stdout="", stderr="", return_code=0):
#     result = fabric.operations._AttributeString(stdout)
#     result.stderr = stderr
#     result.return_code = return_code
#     result.failed = return_code != 0
#     result.succeeded = return_code == 0
#     return result


# Path: revolver/test/server_test.py
from fudge import patch
from revolver import server
from .utils import run_result
import cuisine

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

from __future__ import absolute_import, division, with_statement





def test_revolver_is_just_a_wrapper():
    assert server.uuid == cuisine.system_uuid


@patch("revolver.file.copy")
def test_timezone_default(copy):
    copy.expects_call().with_args("/usr/share/zoneinfo/UTC", "/etc/localtime")
    server.timezone()


@patch("revolver.file.copy")
def test_timezone(copy):
    copy.expects_call().with_args("/usr/share/zoneinfo/FOO", "/etc/localtime")
    server.timezone("FOO")


@patch("revolver.core.run")
def test_version(run):
    (run.expects_call()
        .with_args("lsb_release --release --short")

        .returns(run_result("foo")))