# Path: yagocd/resources/pipeline.py
# class PipelineManager(BaseManager):
# class PipelineEntity(BaseNode):
# class PipelineInstance(BaseNode):
#     GROUPS_RESOURCE_PATH = '{base_api}/config/pipeline_groups'
#     RESOURCE_PATH = '{base_api}/pipelines/{name}'
#     VSM_RESOURCE_PATH = '{base_api}/pipelines/value_stream_map/{name}'
#     def __iter__(self):
#     def __getitem__(self, name):
#     def list(self):
#     def find(self, name):
#     def history(self, name, offset=0):
#     def full_history(self, name):
#     def last(self, name):
#     def get(self, name, counter):
#     def status(self, name):
#     def pause(self, name, cause):
#     def unpause(self, name):
#     def release_lock(self, name):
#     def schedule(self, name, materials=None, variables=None, secure_variables=None):
#     def schedule_with_instance(
#         self,
#         name,
#         materials=None,
#         variables=None,
#         secure_variables=None,
#         backoff=0.5,
#         max_tries=20
#     ):
#     def value_stream_map(self, name, counter):
#     def __init__(self, session, data, group=None):
#     def __iter__(self):
#     def __getitem__(self, counter):
#     def group(self):
#     def get_url(server_url, pipeline_name):
#     def url(self):
#     def config(self):
#     def history(self, offset=0):
#     def full_history(self):
#     def last(self):
#     def get(self, counter):
#     def status(self):
#     def pause(self, cause):
#     def unpause(self):
#     def release_lock(self):
#     def schedule(self, materials=None, variables=None, secure_variables=None):
#     def schedule_with_instance(
#         self,
#         materials=None,
#         variables=None,
#         secure_variables=None,
#         backoff=0.5,
#         max_tries=20
#     ):
#     def value_stream_map(self, counter):
#     def __init__(self, session, data):
#     def __iter__(self):
#     def __getitem__(self, name):
#     def url(self):
#     def pipeline_url(self):
#     def stages(self):
#     def stage(self, name):
#     def value_stream_map(self):
#     def config(self):
# 
# Path: yagocd/util.py
# class YagocdUtil(object):
# class Since(object):
# class RequireParamMixin(object):
#     def build_graph(nodes, dependencies, compare):
#     def graph_depth_walk(root_nodes, near_nodes):
#     def choose_option(cls, version_to_options, default, server_version):
#     def __init__(self, since_version):
#     def __call__(self, entity):
#         def decorated(*args, **kwargs):
#     def _require_param(self, name, values):
#     ENABLED = True


import pytest
from mock import mock
from yagocd.resources import pipeline
from yagocd.util import since, YagocdUtil
    def test_decorate_class(self, dummy_cls, since_version, expected_exc):
        decorated = since(since_version)(dummy_cls)
        assert callable(decorated.foo)
        assert callable(decorated.bar)
        assert decorated is dummy_cls

        assert decorated.foo.since_version == since_version
        assert decorated.bar.since_version == since_version

        if expected_exc:
            with pytest.raises(expected_exc):
                dummy_cls().foo()
            with pytest.raises(expected_exc):
                dummy_cls().bar(3)
        else:
            dummy_cls().foo()
            dummy_cls().bar(3)

    def test_decorate_method(self, dummy_cls, since_version, expected_exc):
        decorated_foo = since(since_version)(dummy_cls.foo)
        dummy_cls.foo = decorated_foo

        if expected_exc:
            with pytest.raises(expected_exc):
                dummy_cls().foo()
        else:
            dummy_cls().foo()
            dummy_cls().bar(3)

    def test_decorate_method_and_class(self, dummy_cls, since_version, expected_exc):

# Path: yagocd/resources/pipeline.py
# class PipelineManager(BaseManager):
# class PipelineEntity(BaseNode):
# class PipelineInstance(BaseNode):
#     GROUPS_RESOURCE_PATH = '{base_api}/config/pipeline_groups'
#     RESOURCE_PATH = '{base_api}/pipelines/{name}'
#     VSM_RESOURCE_PATH = '{base_api}/pipelines/value_stream_map/{name}'
#     def __iter__(self):
#     def __getitem__(self, name):
#     def list(self):
#     def find(self, name):
#     def history(self, name, offset=0):
#     def full_history(self, name):
#     def last(self, name):
#     def get(self, name, counter):
#     def status(self, name):
#     def pause(self, name, cause):
#     def unpause(self, name):
#     def release_lock(self, name):
#     def schedule(self, name, materials=None, variables=None, secure_variables=None):
#     def schedule_with_instance(
#         self,
#         name,
#         materials=None,
#         variables=None,
#         secure_variables=None,
#         backoff=0.5,
#         max_tries=20
#     ):
#     def value_stream_map(self, name, counter):
#     def __init__(self, session, data, group=None):
#     def __iter__(self):
#     def __getitem__(self, counter):
#     def group(self):
#     def get_url(server_url, pipeline_name):
#     def url(self):
#     def config(self):
#     def history(self, offset=0):
#     def full_history(self):
#     def last(self):
#     def get(self, counter):
#     def status(self):
#     def pause(self, cause):
#     def unpause(self):
#     def release_lock(self):
#     def schedule(self, materials=None, variables=None, secure_variables=None):
#     def schedule_with_instance(
#         self,
#         materials=None,
#         variables=None,
#         secure_variables=None,
#         backoff=0.5,
#         max_tries=20
#     ):
#     def value_stream_map(self, counter):
#     def __init__(self, session, data):
#     def __iter__(self):
#     def __getitem__(self, name):
#     def url(self):
#     def pipeline_url(self):
#     def stages(self):
#     def stage(self, name):
#     def value_stream_map(self):
#     def config(self):
# 
# Path: yagocd/util.py
# class YagocdUtil(object):
# class Since(object):
# class RequireParamMixin(object):
#     def build_graph(nodes, dependencies, compare):
#     def graph_depth_walk(root_nodes, near_nodes):
#     def choose_option(cls, version_to_options, default, server_version):
#     def __init__(self, since_version):
#     def __call__(self, entity):
#         def decorated(*args, **kwargs):
#     def _require_param(self, name, values):
#     ENABLED = True


# Path: tests/test_util.py
import pytest
from mock import mock
from yagocd.resources import pipeline
from yagocd.util import since, YagocdUtil

    def test_decorate_class(self, dummy_cls, since_version, expected_exc):
        decorated = since(since_version)(dummy_cls)
        assert callable(decorated.foo)
        assert callable(decorated.bar)
        assert decorated is dummy_cls

        assert decorated.foo.since_version == since_version
        assert decorated.bar.since_version == since_version

        if expected_exc:
            with pytest.raises(expected_exc):
                dummy_cls().foo()
            with pytest.raises(expected_exc):
                dummy_cls().bar(3)
        else:
            dummy_cls().foo()
            dummy_cls().bar(3)

    def test_decorate_method(self, dummy_cls, since_version, expected_exc):
        decorated_foo = since(since_version)(dummy_cls.foo)
        dummy_cls.foo = decorated_foo

        if expected_exc:
            with pytest.raises(expected_exc):
                dummy_cls().foo()
        else:
            dummy_cls().foo()
            dummy_cls().bar(3)

    def test_decorate_method_and_class(self, dummy_cls, since_version, expected_exc):

        decorated = since('1.1.1')(dummy_cls)