# Path: heatclient/common/utils.py
# LOG = logging.getLogger(__name__)
# def arg(*args, **kwargs):
#     def _decorator(func):
# def env(*args, **kwargs):
# def add_arg(func, *args, **kwargs):
# def print_list(objs, fields, formatters=None, sortby_index=0,
#                mixed_case_fields=None, field_labels=None):
# def link_formatter(links):
#     def format_link(l):
# def resource_nested_identifier(rsrc):
# def json_formatter(js):
# def yaml_formatter(js):
# def text_wrap_formatter(d):
# def newline_list_formatter(r):
# def print_dict(d, formatters=None):
#     def __init__(self):
#     def prepend_paths(self, resource_path, stack_id):
#     def build_resource_name(self, event):
#         def get_stack_id():
# def event_log_formatter(events, event_log_context=None):
# def print_update_list(lst, fields, formatters=None):
# def find_resource(manager, name_or_id):
# def format_parameters(params, parse_semicolon=True):
# def format_all_parameters(params, param_files,
#                           template_file=None, template_url=None):
# def format_parameter_file(param_files, template_file=None,
#                           template_url=None):
# def resolve_param_get_file(file, base_url):
# def format_output(output, format='yaml'):
# def parse_query_url(url):
# def get_template_url(template_file=None, template_url=None):
# def read_url_content(url):
# def base_url_for_url(url):
# def normalise_file_path_to_url(path):
# def get_response_body(resp):
# class EventLogContext(object):
# 
# Path: heatclient/v1/resource_types.py
# class ResourceType(base.Resource):
# class ResourceTypeManager(base.BaseManager):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def _add_details(self, info):
#     def list(self, **kwargs):
#     def get(self, resource_type, with_description=False):
#     def generate_template(self, resource_type, template_type='cfn'):
#     KEY = 'resource_types'


from unittest import mock
from heatclient.common import utils
from heatclient.v1 import resource_types
import testtools
        filters = {'name': 'OS::Keystone::*',
                   'version': '5.0.0',
                   'support_status': 'SUPPORTED'}

        manager = resource_types.ResourceTypeManager(None)
        with mock.patch.object(manager, '_list') as mock_list:
            mock_list.return_value = None
            manager.list(filters=filters)
            self.assertEqual(1, mock_list.call_count)
            url, param = mock_list.call_args[0]
            self.assertEqual("resource_types", param)
            base_url, query_params = utils.parse_query_url(url)
            self.assertEqual('/%s' % manager.KEY, base_url)
            # parameters in query_params is in list format, so filter params
            # are made to be inline with it
            filters_params = {}
            for item in filters:
                filters_params[item] = [filters[item]]

            self.assertEqual(filters_params, query_params)

    @mock.patch.object(utils, 'get_response_body')
    def test_get(self, mock_utils):
        key = 'resource_types'
        resource_type = 'OS::Nova::KeyPair'
        expect = ('GET', '/resource_types/OS%3A%3ANova%3A%3AKeyPair')
        manager = self._base_test(expect, key)
        mock_utils.return_value = None
        manager.get(resource_type)


# Path: heatclient/common/utils.py
# LOG = logging.getLogger(__name__)
# def arg(*args, **kwargs):
#     def _decorator(func):
# def env(*args, **kwargs):
# def add_arg(func, *args, **kwargs):
# def print_list(objs, fields, formatters=None, sortby_index=0,
#                mixed_case_fields=None, field_labels=None):
# def link_formatter(links):
#     def format_link(l):
# def resource_nested_identifier(rsrc):
# def json_formatter(js):
# def yaml_formatter(js):
# def text_wrap_formatter(d):
# def newline_list_formatter(r):
# def print_dict(d, formatters=None):
#     def __init__(self):
#     def prepend_paths(self, resource_path, stack_id):
#     def build_resource_name(self, event):
#         def get_stack_id():
# def event_log_formatter(events, event_log_context=None):
# def print_update_list(lst, fields, formatters=None):
# def find_resource(manager, name_or_id):
# def format_parameters(params, parse_semicolon=True):
# def format_all_parameters(params, param_files,
#                           template_file=None, template_url=None):
# def format_parameter_file(param_files, template_file=None,
#                           template_url=None):
# def resolve_param_get_file(file, base_url):
# def format_output(output, format='yaml'):
# def parse_query_url(url):
# def get_template_url(template_file=None, template_url=None):
# def read_url_content(url):
# def base_url_for_url(url):
# def normalise_file_path_to_url(path):
# def get_response_body(resp):
# class EventLogContext(object):
# 
# Path: heatclient/v1/resource_types.py
# class ResourceType(base.Resource):
# class ResourceTypeManager(base.BaseManager):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def _add_details(self, info):
#     def list(self, **kwargs):
#     def get(self, resource_type, with_description=False):
#     def generate_template(self, resource_type, template_type='cfn'):
#     KEY = 'resource_types'


# Path: heatclient/tests/unit/test_resource_types.py
from unittest import mock
from heatclient.common import utils
from heatclient.v1 import resource_types
import testtools

        filters = {'name': 'OS::Keystone::*',
                   'version': '5.0.0',
                   'support_status': 'SUPPORTED'}

        manager = resource_types.ResourceTypeManager(None)
        with mock.patch.object(manager, '_list') as mock_list:
            mock_list.return_value = None
            manager.list(filters=filters)
            self.assertEqual(1, mock_list.call_count)
            url, param = mock_list.call_args[0]
            self.assertEqual("resource_types", param)
            base_url, query_params = utils.parse_query_url(url)
            self.assertEqual('/%s' % manager.KEY, base_url)
            # parameters in query_params is in list format, so filter params
            # are made to be inline with it
            filters_params = {}
            for item in filters:
                filters_params[item] = [filters[item]]

            self.assertEqual(filters_params, query_params)

    @mock.patch.object(utils, 'get_response_body')
    def test_get(self, mock_utils):
        key = 'resource_types'
        resource_type = 'OS::Nova::KeyPair'
        expect = ('GET', '/resource_types/OS%3A%3ANova%3A%3AKeyPair')
        manager = self._base_test(expect, key)
        mock_utils.return_value = None
        manager.get(resource_type)


    @mock.patch.object(utils, 'get_response_body')