# Path: heatclient/exc.py
# class BaseException(Exception):
# class CommandError(BaseException):
# class InvalidEndpoint(BaseException):
# class CommunicationError(BaseException):
# class HTTPException(BaseException):
# class HTTPMultipleChoices(HTTPException):
# class BadRequest(HTTPException):
# class HTTPBadRequest(BadRequest):
# class Unauthorized(HTTPException):
# class HTTPUnauthorized(Unauthorized):
# class Forbidden(HTTPException):
# class HTTPForbidden(Forbidden):
# class NotFound(HTTPException):
# class HTTPNotFound(NotFound):
# class NoUniqueMatch(HTTPException):
# class HTTPMethodNotAllowed(HTTPException):
# class Conflict(HTTPException):
# class HTTPConflict(Conflict):
# class OverLimit(HTTPException):
# class HTTPOverLimit(OverLimit):
# class HTTPUnsupported(HTTPException):
# class HTTPInternalServerError(HTTPException):
# class HTTPNotImplemented(HTTPException):
# class HTTPBadGateway(HTTPException):
# class ServiceUnavailable(HTTPException):
# class HTTPServiceUnavailable(ServiceUnavailable):
# class NoTokenLookupException(Exception):
# class EndpointNotFound(Exception):
# class StackFailure(Exception):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, message=None, code=None):
#     def __str__(self):
#     def __str__(self):
# def from_response(response):
# 
# Path: heatclient/osc/v1/template.py
# class VersionList(command.Lister):
# class FunctionList(command.Lister):
# class Validate(format_utils.YamlFormat):
#     def take_action(self, parsed_args):
#             def format_alias(aliases):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# def _validate(heat_client, args):
# 
# Path: heatclient/tests/unit/osc/v1/fakes.py
# class TestOrchestrationv1(utils.TestCommand):
#     def setUp(self):
# 
# Path: heatclient/v1/template_versions.py
# class TemplateVersion(base.Resource):
# class TemplateVersionManager(base.BaseManager):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def list(self):
#     def get(self, template_version, **kwargs):


from unittest import mock
from heatclient import exc
from heatclient.osc.v1 import template
from heatclient.tests.unit.osc.v1 import fakes
from heatclient.v1 import template_versions

    def test_version_list_with_aliases(self):
        ret_data = [
            {'version': 'HOT123', 'type': 'hot', 'aliases': ['releasex']},
            {'version': 'CFN456', 'type': 'cfn', 'aliases': ['releasey']}]
        self._stub_versions_list(ret_data)
        parsed_args = self.check_parser(self.cmd, [], [])

        columns, data = self.cmd.take_action(parsed_args)

        self.assertEqual(['Version', 'Type', 'Aliases'], columns)
        self.assertEqual([('HOT123', 'hot', 'releasex'),
                          ('CFN456', 'cfn', 'releasey')], list(data))


class TestTemplateFunctionList(TestTemplate):

    defaults = [
        {'functions': 'func1', 'description': 'Function 1'},
        {'functions': 'func2', 'description': 'Function 2'},
        {'functions': 'condition func', 'description': 'Condition Function'}
    ]

    def setUp(self):
        super(TestTemplateFunctionList, self).setUp()
        self.tv1 = template_versions.TemplateVersion(None, self.defaults[0])
        self.tv2 = template_versions.TemplateVersion(None, self.defaults[1])
        self.tv_with_cf = template_versions.TemplateVersion(
            None, self.defaults[2])


# Path: heatclient/exc.py
# class BaseException(Exception):
# class CommandError(BaseException):
# class InvalidEndpoint(BaseException):
# class CommunicationError(BaseException):
# class HTTPException(BaseException):
# class HTTPMultipleChoices(HTTPException):
# class BadRequest(HTTPException):
# class HTTPBadRequest(BadRequest):
# class Unauthorized(HTTPException):
# class HTTPUnauthorized(Unauthorized):
# class Forbidden(HTTPException):
# class HTTPForbidden(Forbidden):
# class NotFound(HTTPException):
# class HTTPNotFound(NotFound):
# class NoUniqueMatch(HTTPException):
# class HTTPMethodNotAllowed(HTTPException):
# class Conflict(HTTPException):
# class HTTPConflict(Conflict):
# class OverLimit(HTTPException):
# class HTTPOverLimit(OverLimit):
# class HTTPUnsupported(HTTPException):
# class HTTPInternalServerError(HTTPException):
# class HTTPNotImplemented(HTTPException):
# class HTTPBadGateway(HTTPException):
# class ServiceUnavailable(HTTPException):
# class HTTPServiceUnavailable(ServiceUnavailable):
# class NoTokenLookupException(Exception):
# class EndpointNotFound(Exception):
# class StackFailure(Exception):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, message=None, code=None):
#     def __str__(self):
#     def __str__(self):
# def from_response(response):
# 
# Path: heatclient/osc/v1/template.py
# class VersionList(command.Lister):
# class FunctionList(command.Lister):
# class Validate(format_utils.YamlFormat):
#     def take_action(self, parsed_args):
#             def format_alias(aliases):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# def _validate(heat_client, args):
# 
# Path: heatclient/tests/unit/osc/v1/fakes.py
# class TestOrchestrationv1(utils.TestCommand):
#     def setUp(self):
# 
# Path: heatclient/v1/template_versions.py
# class TemplateVersion(base.Resource):
# class TemplateVersionManager(base.BaseManager):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def list(self):
#     def get(self, template_version, **kwargs):


# Path: heatclient/tests/unit/osc/v1/test_template.py
from unittest import mock
from heatclient import exc
from heatclient.osc.v1 import template
from heatclient.tests.unit.osc.v1 import fakes
from heatclient.v1 import template_versions


    def test_version_list_with_aliases(self):
        ret_data = [
            {'version': 'HOT123', 'type': 'hot', 'aliases': ['releasex']},
            {'version': 'CFN456', 'type': 'cfn', 'aliases': ['releasey']}]
        self._stub_versions_list(ret_data)
        parsed_args = self.check_parser(self.cmd, [], [])

        columns, data = self.cmd.take_action(parsed_args)

        self.assertEqual(['Version', 'Type', 'Aliases'], columns)
        self.assertEqual([('HOT123', 'hot', 'releasex'),
                          ('CFN456', 'cfn', 'releasey')], list(data))


class TestTemplateFunctionList(TestTemplate):

    defaults = [
        {'functions': 'func1', 'description': 'Function 1'},
        {'functions': 'func2', 'description': 'Function 2'},
        {'functions': 'condition func', 'description': 'Condition Function'}
    ]

    def setUp(self):
        super(TestTemplateFunctionList, self).setUp()
        self.tv1 = template_versions.TemplateVersion(None, self.defaults[0])
        self.tv2 = template_versions.TemplateVersion(None, self.defaults[1])
        self.tv_with_cf = template_versions.TemplateVersion(
            None, self.defaults[2])


        self.cmd = template.FunctionList(self.app, None)