# 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/events.py
# DEFAULT_PAGE_SIZE = 20
# class Event(base.Resource):
# class EventManager(stacks.StackChildManager):
#     def __repr__(self):
#     def update(self, **fields):
#     def delete(self):
#     def data(self, **kwargs):
#     def list(self, stack_id, resource_name=None, **kwargs):
#     def get(self, stack_id, resource_name, event_id):


from unittest import mock
from heatclient.common import utils
from heatclient.v1 import events
import testtools
                '/stacks/teststack/abcd1234/'
                'resources/%E5%B7%A5%E4%BD%9C/'
                'events', "events")
            mock_re.assert_called_once_with(stack_id)

    def test_list_event_with_none_resource_name(self):
        stack_id = 'teststack',
        manager = events.EventManager(None)
        manager._list = mock.MagicMock()
        manager.list(stack_id)
        # Make sure url is correct.
        manager._list.assert_called_once_with('/stacks/teststack/'
                                              'events', "events")

    def test_list_event_with_kwargs(self):
        stack_id = 'teststack',
        resource_name = 'testresource'
        kwargs = {'limit': 2,
                  'marker': '6d6935f4-0ae5',
                  'filters': {
                      'resource_action': 'CREATE',
                      'resource_status': 'COMPLETE'
                  }}
        manager = events.EventManager(None)
        manager = events.EventManager(None)
        with mock.patch('heatclient.v1.events.EventManager._resolve_stack_id')\
                as mock_re:
            mock_re.return_value = 'teststack/abcd1234'

            manager._list = mock.MagicMock()

# 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/events.py
# DEFAULT_PAGE_SIZE = 20
# class Event(base.Resource):
# class EventManager(stacks.StackChildManager):
#     def __repr__(self):
#     def update(self, **fields):
#     def delete(self):
#     def data(self, **kwargs):
#     def list(self, stack_id, resource_name=None, **kwargs):
#     def get(self, stack_id, resource_name, event_id):


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

                '/stacks/teststack/abcd1234/'
                'resources/%E5%B7%A5%E4%BD%9C/'
                'events', "events")
            mock_re.assert_called_once_with(stack_id)

    def test_list_event_with_none_resource_name(self):
        stack_id = 'teststack',
        manager = events.EventManager(None)
        manager._list = mock.MagicMock()
        manager.list(stack_id)
        # Make sure url is correct.
        manager._list.assert_called_once_with('/stacks/teststack/'
                                              'events', "events")

    def test_list_event_with_kwargs(self):
        stack_id = 'teststack',
        resource_name = 'testresource'
        kwargs = {'limit': 2,
                  'marker': '6d6935f4-0ae5',
                  'filters': {
                      'resource_action': 'CREATE',
                      'resource_status': 'COMPLETE'
                  }}
        manager = events.EventManager(None)
        manager = events.EventManager(None)
        with mock.patch('heatclient.v1.events.EventManager._resolve_stack_id')\
                as mock_re:
            mock_re.return_value = 'teststack/abcd1234'

            manager._list = mock.MagicMock()

            manager.list(stack_id, resource_name, **kwargs)