# Path: cloudify/workflows/local.py
#     HOST_TYPE = None
# class _Environment(object):
# class _Storage(object):
# class InMemoryStorage(_Storage):
# class FileStorage(_Storage):
# class StorageConflictError(Exception):
#     def __init__(self,
#                  storage,
#                  blueprint_path=None,
#                  name='local',
#                  inputs=None,
#                  load_existing=False,
#                  ignored_modules=None,
#                  provider_context=None,
#                  resolver=None,
#                  validate_version=True):
#     def plan(self):
#     def name(self):
#     def outputs(self):
#     def evaluate_functions(self, payload, context):
#     def execute(self,
#                 workflow,
#                 parameters=None,
#                 allow_custom_parameters=False,
#                 task_retries=-1,
#                 task_retry_interval=30,
#                 subgraph_retries=0,
#                 task_thread_pool_size=DEFAULT_LOCAL_TASK_THREAD_POOL_SIZE):
# def init_env(blueprint_path,
#              name='local',
#              inputs=None,
#              storage=None,
#              ignored_modules=None,
#              provider_context=None,
#              resolver=None,
#              validate_version=True):
# def load_env(name, storage, resolver=None):
# def _parse_plan(blueprint_path, inputs, ignored_modules, resolver,
#                 validate_version):
# def _validate_node(node):
# def _prepare_nodes_and_instances(nodes, node_instances, ignored_modules):
#     def scan(parent, name, node):
# def _get_module_method(module_method_path, tpe, node_name,
#                        ignored_modules=None):
# def _try_convert_from_str(string, target_type):
# def _merge_and_validate_execution_parameters(
#         workflow, workflow_name, execution_parameters=None,
#         allow_custom_parameters=False):
#     def __init__(self):
#     def init(self, name, plan, nodes, node_instances, blueprint_path,
#              provider_context):
#     def _init_locks_and_nodes(self, nodes):
#     def load(self, name):
#     def get_resource(self, resource_path):
#     def download_resource(self, resource_path, target_path=None):
#     def update_node_instance(self,
#                              node_instance_id,
#                              version,
#                              runtime_properties=None,
#                              state=None):
#     def _get_node_instance(self, node_instance_id):
#     def get_node(self, node_id):
#     def get_nodes(self):
#     def get_node_instance(self, node_instance_id):
#     def get_provider_context(self):
#     def _load_instance(self, node_instance_id):
#     def _store_instance(self, node_instance):
#     def get_node_instances(self, node_id=None):
#     def _instance_ids(self):
#     def _lock(self, node_instance_id):
#     def get_workdir(self):
#     def get_secret(self):
#     def __init__(self):
#     def init(self, name, plan, nodes, node_instances, blueprint_path,
#              provider_context):
#     def load(self, name):
#     def _load_instance(self, node_instance_id):
#     def _store_instance(self, node_instance):
#     def get_node_instances(self, node_id=None):
#     def _instance_ids(self):
#     def get_workdir(self):
#     def __init__(self, storage_dir='/tmp/cloudify-workflows'):
#     def init(self, name, plan, nodes, node_instances, blueprint_path,
#              provider_context):
#         def ignore(src, names):
#     def load(self, name):
#     def payload(self):
#     def get_blueprint_path(self):
#     def get_node_instance(self, node_instance_id):
#     def _load_instance(self, node_instance_id):
#     def _store_instance(self, node_instance, lock=True):
#     def _instance_path(self, node_instance_id):
#     def get_node_instances(self, node_id=None):
#     def _instance_ids(self):
#     def get_workdir(self):


import os
import testtools
from testtools.testcase import ExpectedException
from cloudify.workflows import local
########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# 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.





class InstallAgentTest(testtools.TestCase):

    def test_install_agent(self):
        blueprint_path = os.path.join(
            os.path.dirname(os.path.realpath(__file__)),
            "resources/blueprints/test-install-agent-blueprint.yaml")

        with ExpectedException(ValueError,
                               "'install_agent': true is not supported*"):

# Path: cloudify/workflows/local.py
#     HOST_TYPE = None
# class _Environment(object):
# class _Storage(object):
# class InMemoryStorage(_Storage):
# class FileStorage(_Storage):
# class StorageConflictError(Exception):
#     def __init__(self,
#                  storage,
#                  blueprint_path=None,
#                  name='local',
#                  inputs=None,
#                  load_existing=False,
#                  ignored_modules=None,
#                  provider_context=None,
#                  resolver=None,
#                  validate_version=True):
#     def plan(self):
#     def name(self):
#     def outputs(self):
#     def evaluate_functions(self, payload, context):
#     def execute(self,
#                 workflow,
#                 parameters=None,
#                 allow_custom_parameters=False,
#                 task_retries=-1,
#                 task_retry_interval=30,
#                 subgraph_retries=0,
#                 task_thread_pool_size=DEFAULT_LOCAL_TASK_THREAD_POOL_SIZE):
# def init_env(blueprint_path,
#              name='local',
#              inputs=None,
#              storage=None,
#              ignored_modules=None,
#              provider_context=None,
#              resolver=None,
#              validate_version=True):
# def load_env(name, storage, resolver=None):
# def _parse_plan(blueprint_path, inputs, ignored_modules, resolver,
#                 validate_version):
# def _validate_node(node):
# def _prepare_nodes_and_instances(nodes, node_instances, ignored_modules):
#     def scan(parent, name, node):
# def _get_module_method(module_method_path, tpe, node_name,
#                        ignored_modules=None):
# def _try_convert_from_str(string, target_type):
# def _merge_and_validate_execution_parameters(
#         workflow, workflow_name, execution_parameters=None,
#         allow_custom_parameters=False):
#     def __init__(self):
#     def init(self, name, plan, nodes, node_instances, blueprint_path,
#              provider_context):
#     def _init_locks_and_nodes(self, nodes):
#     def load(self, name):
#     def get_resource(self, resource_path):
#     def download_resource(self, resource_path, target_path=None):
#     def update_node_instance(self,
#                              node_instance_id,
#                              version,
#                              runtime_properties=None,
#                              state=None):
#     def _get_node_instance(self, node_instance_id):
#     def get_node(self, node_id):
#     def get_nodes(self):
#     def get_node_instance(self, node_instance_id):
#     def get_provider_context(self):
#     def _load_instance(self, node_instance_id):
#     def _store_instance(self, node_instance):
#     def get_node_instances(self, node_id=None):
#     def _instance_ids(self):
#     def _lock(self, node_instance_id):
#     def get_workdir(self):
#     def get_secret(self):
#     def __init__(self):
#     def init(self, name, plan, nodes, node_instances, blueprint_path,
#              provider_context):
#     def load(self, name):
#     def _load_instance(self, node_instance_id):
#     def _store_instance(self, node_instance):
#     def get_node_instances(self, node_id=None):
#     def _instance_ids(self):
#     def get_workdir(self):
#     def __init__(self, storage_dir='/tmp/cloudify-workflows'):
#     def init(self, name, plan, nodes, node_instances, blueprint_path,
#              provider_context):
#         def ignore(src, names):
#     def load(self, name):
#     def payload(self):
#     def get_blueprint_path(self):
#     def get_node_instance(self, node_instance_id):
#     def _load_instance(self, node_instance_id):
#     def _store_instance(self, node_instance, lock=True):
#     def _instance_path(self, node_instance_id):
#     def get_node_instances(self, node_id=None):
#     def _instance_ids(self):
#     def get_workdir(self):


# Path: cloudify/tests/test_install_agent_local_workflow.py
import os
import testtools
from testtools.testcase import ExpectedException
from cloudify.workflows import local

########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# 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.





class InstallAgentTest(testtools.TestCase):

    def test_install_agent(self):
        blueprint_path = os.path.join(
            os.path.dirname(os.path.realpath(__file__)),
            "resources/blueprints/test-install-agent-blueprint.yaml")

        with ExpectedException(ValueError,
                               "'install_agent': true is not supported*"):

            self.env = local.init_env(blueprint_path)