# Path: muranoagent/execution_plan_queue.py
# CONF = config.CONF
# LOG = logging.getLogger(__name__)
# class ExecutionPlanQueue(object):
#     def __init__(self):
#     def put_execution_plan(self, execution_plan, signature, msg_id, reply_to):
#     def _get_first_timestamp(self, filename):
#         def predicate(folder):
#     def _get_first_file(self, filename):
#     def get_execution_plan(self):
#     def _verify_signature(self, data, signature):
#     def put_execution_result(self, result, execution_plan):
#     def remove(self, timestamp):
#     def get_execution_plan_result(self):
#     def _load_stamp(self):
#     def _save_stamp(self, stamp):
# 
# 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 execution_plan_queue
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 builtins
import fixtures
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.





CONF = cfg.CONF


class TestExecutionPlanQueue(base.MuranoAgentTestCase,
                             fixtures.FunctionFixture):

    @mock.patch('os.chmod')
    @mock.patch('os.path.exists')
    def setUp(self, mock_path, mock_chmod):
        super(TestExecutionPlanQueue, self).setUp()
        mock_path.side_effect = self._exists
        self.epq = execution_plan_queue.ExecutionPlanQueue()
        CONF.set_override('storage', 'cache')
        self.addCleanup(CONF.clear_override, 'storage')

    @staticmethod
    def _exists(path):
        return 'stamp' not in path

    @mock.patch('os.path.lexists')
    @mock.patch('os.path.isdir')

# Path: muranoagent/execution_plan_queue.py
# CONF = config.CONF
# LOG = logging.getLogger(__name__)
# class ExecutionPlanQueue(object):
#     def __init__(self):
#     def put_execution_plan(self, execution_plan, signature, msg_id, reply_to):
#     def _get_first_timestamp(self, filename):
#         def predicate(folder):
#     def _get_first_file(self, filename):
#     def get_execution_plan(self):
#     def _verify_signature(self, data, signature):
#     def put_execution_result(self, result, execution_plan):
#     def remove(self, timestamp):
#     def get_execution_plan_result(self):
#     def _load_stamp(self):
#     def _save_stamp(self, stamp):
# 
# 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_execution_plan_queue.py
from unittest import mock
from muranoagent import execution_plan_queue
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 builtins
import fixtures

#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.





CONF = cfg.CONF


class TestExecutionPlanQueue(base.MuranoAgentTestCase,
                             fixtures.FunctionFixture):

    @mock.patch('os.chmod')
    @mock.patch('os.path.exists')
    def setUp(self, mock_path, mock_chmod):
        super(TestExecutionPlanQueue, self).setUp()
        mock_path.side_effect = self._exists
        self.epq = execution_plan_queue.ExecutionPlanQueue()
        CONF.set_override('storage', 'cache')
        self.addCleanup(CONF.clear_override, 'storage')

    @staticmethod
    def _exists(path):
        return 'stamp' not in path

    @mock.patch('os.path.lexists')
    @mock.patch('os.path.isdir')

    @mock.patch('os.mkdir')