# Path: muranoagent/app.py
# CONF = config.CONF
# LOG = logging.getLogger(__name__)
# class MuranoAgent(service.Service):
#     def __init__(self):
#     def _load_package(name):
#     def _load(self):
#     def start(self):
#     def _loop_func(self, msg_iterator):
#     def _verify_plan(self, plan):
#     def _run(self, plan):
#     def _send_result(self, result):
#     def _create_rmq_client(self):
#     def _wait_plan(self):
# 
# Path: muranoagent/bunch.py
# class Bunch(dict):
#     def __getattr__(self, item):
#     def __setattr__(self, key, value):
#     def __delattr__(self, key):
# 
# Path: muranoagent/common/config.py
# CONF = cfg.CONF
# def parse_args(args=None, usage=None, default_config_files=None):
# 
# Path: muranoagent/common/messaging/mqclient.py
# class MqClient(object):
#     def __init__(self, login, password, host, port, virtual_host,
#                  ssl=False, ssl_version=None, ca_certs=None, insecure=False):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_val, exc_tb):
#     def connect(self):
#     def close(self):
#     def _check_exception(self):
#     def _heartbeater(self):
#     def declare(self, queue, exchange='', enable_ha=False, ttl=0):
#     def send(self, message, key, exchange=''):
#     def open(self, queue, prefetch_count=1):
# 
# Path: muranoagent/exceptions.py
# class AgentException(Exception):
# class CustomException(AgentException):
# class IncorrectFormat(AgentException):
#     def __init__(self, code, message=None, additional_data=None):
#     def error_code(self):
#     def additional_data(self):
#     def __init__(self, code, message=None, additional_data=None):
# 
# Path: muranoagent/tests/unit/base.py
# CONF = cfg.CONF
# class MuranoAgentTestCase(testtools.TestCase):
#     def setUp(self):
#     def override_config(self, name, override, group=None):
# 
# Path: muranoagent/tests/unit/execution_plan.py
# class ExPlanDownloable(fixtures.Fixture):
# class ExPlanApplication(fixtures.Fixture):
# class ExPlanDownloableWrongFormat(fixtures.Fixture):
# class ExPlanDownloableNoFiles(fixtures.Fixture):
# class PuppetExPlanDownloable(fixtures.Fixture):
# class ExPlanBerkshelf(fixtures.Fixture):
# class ExPlanCustomBerskfile(fixtures.Fixture):
# class ExPlanBerkWrongVersion(fixtures.Fixture):
#     def setUp(self):
#     def setUp(self):
#     def setUp(self):
#     def setUp(self):
#     def setUp(self):
#     def setUp(self):
#     def setUp(self):
#     def setUp(self):
# 
# Path: muranoagent/validation.py
# def validate_plan(plan):
# def _validate_script(name, script, plan_format_version, plan):
# def _validate_file(plan_file, key, format_version):


from unittest import mock
from muranoagent import app
from muranoagent import bunch
from muranoagent.common import config as cfg
from muranoagent.common.messaging import mqclient
from muranoagent import exceptions as exc
from muranoagent.tests.unit import base
from muranoagent.tests.unit import execution_plan as ep
from muranoagent import validation
import fixtures
import ssl as ssl_module
        template = self.useFixture(ep.ExPlanDownloable()).execution_plan
        self.agent._verify_plan(template)

    def test_verify_execution_plan_wrong_format(self):
        template = bunch.Bunch(
            ID='ID',
            FormatVersion='0.0.0',
        )
        self.assertRaises(exc.IncorrectFormat,
                          validation.validate_plan, template)

    def test_verify_over_max_execution_plan(self):
        template = self.useFixture(ep.ExPlanApplication()).execution_plan
        template['FormatVersion'] = '1000.0.0'
        self.assertRaises(exc.IncorrectFormat,
                          validation.validate_plan, template)

    def test_verify_execution_application(self):
        template = self.useFixture(ep.ExPlanApplication()).execution_plan
        self.agent._verify_plan(template)

    def test_verify_wrong_execution_application(self):
        template = self.useFixture(ep.ExPlanApplication()).execution_plan
        template['Files']['ID1'] = {
            'Name': 'tomcat.git',
            'Type': 'Downloadable',
            'URL': 'https://github.com/tomcat.git'
        }
        template['FormatVersion'] = '2.0.0'
        self.assertRaises(exc.IncorrectFormat,

# Path: muranoagent/app.py
# CONF = config.CONF
# LOG = logging.getLogger(__name__)
# class MuranoAgent(service.Service):
#     def __init__(self):
#     def _load_package(name):
#     def _load(self):
#     def start(self):
#     def _loop_func(self, msg_iterator):
#     def _verify_plan(self, plan):
#     def _run(self, plan):
#     def _send_result(self, result):
#     def _create_rmq_client(self):
#     def _wait_plan(self):
# 
# Path: muranoagent/bunch.py
# class Bunch(dict):
#     def __getattr__(self, item):
#     def __setattr__(self, key, value):
#     def __delattr__(self, key):
# 
# Path: muranoagent/common/config.py
# CONF = cfg.CONF
# def parse_args(args=None, usage=None, default_config_files=None):
# 
# Path: muranoagent/common/messaging/mqclient.py
# class MqClient(object):
#     def __init__(self, login, password, host, port, virtual_host,
#                  ssl=False, ssl_version=None, ca_certs=None, insecure=False):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_val, exc_tb):
#     def connect(self):
#     def close(self):
#     def _check_exception(self):
#     def _heartbeater(self):
#     def declare(self, queue, exchange='', enable_ha=False, ttl=0):
#     def send(self, message, key, exchange=''):
#     def open(self, queue, prefetch_count=1):
# 
# Path: muranoagent/exceptions.py
# class AgentException(Exception):
# class CustomException(AgentException):
# class IncorrectFormat(AgentException):
#     def __init__(self, code, message=None, additional_data=None):
#     def error_code(self):
#     def additional_data(self):
#     def __init__(self, code, message=None, additional_data=None):
# 
# Path: muranoagent/tests/unit/base.py
# CONF = cfg.CONF
# class MuranoAgentTestCase(testtools.TestCase):
#     def setUp(self):
#     def override_config(self, name, override, group=None):
# 
# Path: muranoagent/tests/unit/execution_plan.py
# class ExPlanDownloable(fixtures.Fixture):
# class ExPlanApplication(fixtures.Fixture):
# class ExPlanDownloableWrongFormat(fixtures.Fixture):
# class ExPlanDownloableNoFiles(fixtures.Fixture):
# class PuppetExPlanDownloable(fixtures.Fixture):
# class ExPlanBerkshelf(fixtures.Fixture):
# class ExPlanCustomBerskfile(fixtures.Fixture):
# class ExPlanBerkWrongVersion(fixtures.Fixture):
#     def setUp(self):
#     def setUp(self):
#     def setUp(self):
#     def setUp(self):
#     def setUp(self):
#     def setUp(self):
#     def setUp(self):
#     def setUp(self):
# 
# Path: muranoagent/validation.py
# def validate_plan(plan):
# def _validate_script(name, script, plan_format_version, plan):
# def _validate_file(plan_file, key, format_version):


# Path: muranoagent/tests/unit/test_app.py
from unittest import mock
from muranoagent import app
from muranoagent import bunch
from muranoagent.common import config as cfg
from muranoagent.common.messaging import mqclient
from muranoagent import exceptions as exc
from muranoagent.tests.unit import base
from muranoagent.tests.unit import execution_plan as ep
from muranoagent import validation
import fixtures
import ssl as ssl_module

        template = self.useFixture(ep.ExPlanDownloable()).execution_plan
        self.agent._verify_plan(template)

    def test_verify_execution_plan_wrong_format(self):
        template = bunch.Bunch(
            ID='ID',
            FormatVersion='0.0.0',
        )
        self.assertRaises(exc.IncorrectFormat,
                          validation.validate_plan, template)

    def test_verify_over_max_execution_plan(self):
        template = self.useFixture(ep.ExPlanApplication()).execution_plan
        template['FormatVersion'] = '1000.0.0'
        self.assertRaises(exc.IncorrectFormat,
                          validation.validate_plan, template)

    def test_verify_execution_application(self):
        template = self.useFixture(ep.ExPlanApplication()).execution_plan
        self.agent._verify_plan(template)

    def test_verify_wrong_execution_application(self):
        template = self.useFixture(ep.ExPlanApplication()).execution_plan
        template['Files']['ID1'] = {
            'Name': 'tomcat.git',
            'Type': 'Downloadable',
            'URL': 'https://github.com/tomcat.git'
        }
        template['FormatVersion'] = '2.0.0'
        self.assertRaises(exc.IncorrectFormat,

                          validation.validate_plan, template)