# Path: muranoclient/tests/functional/cli/murano_test_utils.py
# class CLIUtilsTestBase(muranoclient.ClientTestBase):
# class TestSuiteRepository(CLIUtilsTestBase):
#             class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
# class CLIUtilsTestPackagesBase(TestSuiteRepository):
#     def delete_murano_object(self, murano_object, obj_to_del):
#     def create_murano_object(self, murano_object, prefix_object_name):
#     def create_murano_object_parameter(self, murano_object, prefix_object_name,
#                                        param):
#     def generate_uuid():
#     def generate_name(prefix):
#     def get_table_struct(self, command, params=""):
#     def get_object(self, object_list, object_value):
#     def get_property_value(self, obj, prop):
#     def setUp(self):
#     def tearDown(self):
#     def run_server(self):
#         def serve_function():
#     def stop_server(self):
#     def _compose_app(self, name, require=None):
#     def import_package(self, pkg_name, pkg_path, *args):
#     def prepare_file_with_obj_model(self, obj_model):
#     def wait_deployment_result(self, env_id, timeout=180):
#     def prepare_bundle_with_non_existed_package(self):
#     def prepare_bundle_with_invalid_format(self):
#     def deploy_environment(self, env_id, obj_model):
# 
# Path: muranoclient/tests/functional/muranoclient.py
# class ClientTestBase(base.ClientTestBase):
#     def murano(self, action, flags='', params='',
#                fail_ok=False, endpoint_type='publicURL', merge_stderr=True):
#     def _get_clients(self):
#     def listing(self, command, params=""):
#     def get_value(self, need_field, known_field, known_value, somelist):
#     def get_backend_flag():


import json
import unittest
from muranoclient.tests.functional.cli import \
    murano_test_utils as utils
from muranoclient.tests.functional import muranoclient as murano_client
from oslo_utils.strutils import bool_from_string as str2bool
            self.app_name,
            self.dummy_app_path
        )

        env_id = self.create_murano_object('environment',
                                           'TestMuranoDeployEnv')['ID']

        obj_model = {
            'op': 'add',
            'path': '/-',
            'value': {
                '?': {
                    'type': 'io.murano.apps.{0}'.format(self.app_name),
                    'id': '{0}'.format(self.generate_uuid()),
                }
            }
        }
        self.deploy_environment(env_id, obj_model)

        obj_model = {
            'op': 'remove',
            'path': '/0'
        }
        self.deploy_environment(env_id, obj_model)

        deployments = self.listing('deployment-list', params=env_id)
        self.assertEqual('success', deployments[1]['State'])
        self.assertEqual(2, len(deployments))



# Path: muranoclient/tests/functional/cli/murano_test_utils.py
# class CLIUtilsTestBase(muranoclient.ClientTestBase):
# class TestSuiteRepository(CLIUtilsTestBase):
#             class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
# class CLIUtilsTestPackagesBase(TestSuiteRepository):
#     def delete_murano_object(self, murano_object, obj_to_del):
#     def create_murano_object(self, murano_object, prefix_object_name):
#     def create_murano_object_parameter(self, murano_object, prefix_object_name,
#                                        param):
#     def generate_uuid():
#     def generate_name(prefix):
#     def get_table_struct(self, command, params=""):
#     def get_object(self, object_list, object_value):
#     def get_property_value(self, obj, prop):
#     def setUp(self):
#     def tearDown(self):
#     def run_server(self):
#         def serve_function():
#     def stop_server(self):
#     def _compose_app(self, name, require=None):
#     def import_package(self, pkg_name, pkg_path, *args):
#     def prepare_file_with_obj_model(self, obj_model):
#     def wait_deployment_result(self, env_id, timeout=180):
#     def prepare_bundle_with_non_existed_package(self):
#     def prepare_bundle_with_invalid_format(self):
#     def deploy_environment(self, env_id, obj_model):
# 
# Path: muranoclient/tests/functional/muranoclient.py
# class ClientTestBase(base.ClientTestBase):
#     def murano(self, action, flags='', params='',
#                fail_ok=False, endpoint_type='publicURL', merge_stderr=True):
#     def _get_clients(self):
#     def listing(self, command, params=""):
#     def get_value(self, need_field, known_field, known_value, somelist):
#     def get_backend_flag():


# Path: muranoclient/tests/functional/cli/test_murano.py
import json
import unittest
from muranoclient.tests.functional.cli import \
    murano_test_utils as utils
from muranoclient.tests.functional import muranoclient as murano_client
from oslo_utils.strutils import bool_from_string as str2bool

            self.app_name,
            self.dummy_app_path
        )

        env_id = self.create_murano_object('environment',
                                           'TestMuranoDeployEnv')['ID']

        obj_model = {
            'op': 'add',
            'path': '/-',
            'value': {
                '?': {
                    'type': 'io.murano.apps.{0}'.format(self.app_name),
                    'id': '{0}'.format(self.generate_uuid()),
                }
            }
        }
        self.deploy_environment(env_id, obj_model)

        obj_model = {
            'op': 'remove',
            'path': '/0'
        }
        self.deploy_environment(env_id, obj_model)

        deployments = self.listing('deployment-list', params=env_id)
        self.assertEqual('success', deployments[1]['State'])
        self.assertEqual(2, len(deployments))



class BundleMuranoSanityClientTest(utils.CLIUtilsTestPackagesBase):