# Path: mako/lookup.py
# class TemplateCollection:
# class TemplateLookup(TemplateCollection):
#     def has_template(self, uri):
#     def get_template(self, uri, relativeto=None):
#     def filename_to_uri(self, uri, filename):
#     def adjust_uri(self, uri, filename):
#     def __init__(
#         self,
#         directories=None,
#         module_directory=None,
#         filesystem_checks=True,
#         collection_size=-1,
#         format_exceptions=False,
#         error_handler=None,
#         output_encoding=None,
#         encoding_errors="strict",
#         cache_args=None,
#         cache_impl="beaker",
#         cache_enabled=True,
#         cache_type=None,
#         cache_dir=None,
#         cache_url=None,
#         modulename_callable=None,
#         module_writer=None,
#         default_filters=None,
#         buffer_filters=(),
#         strict_undefined=False,
#         imports=None,
#         future_imports=None,
#         enable_loop=True,
#         input_encoding=None,
#         preprocessor=None,
#         lexer_cls=None,
#         include_error_handler=None,
#     ):
#     def get_template(self, uri):
#     def adjust_uri(self, uri, relativeto):
#     def filename_to_uri(self, filename):
#     def _relativeize(self, filename):
#     def _load(self, filename, uri):
#     def _check(self, uri, template):
#     def put_string(self, uri, text):
#     def put_template(self, uri, template):
# 
# Path: mako/testing/helpers.py
# def result_lines(result):
#     return [
#         x.strip()
#         for x in re.split(r"\r?\n", re.sub(r" +", " ", result))
#         if x.strip() != ""
#     ]


from mako import lookup
from mako.testing.helpers import result_lines
${parent.d()}
${parent.context['parent'].d()}
${next.body()}
""",
        )

        collection.put_string(
            "general",
            """
<%inherit file="base"/>
<%def name="d()">general_d</%def>
general_body
${next.d()}
${next.context['next'].d()}
${next.body()}
""",
        )
        collection.put_string(
            "base",
            """
base_body
full stack from the base:
    ${self.name} ${self.context['parent'].name} """
            """${self.context['parent'].context['parent'].name} """
            """${self.context['parent'].context['parent'].context['parent'].name}
${next.body()}
<%def name="d()">base_d</%def>
""",
        )


# Path: mako/lookup.py
# class TemplateCollection:
# class TemplateLookup(TemplateCollection):
#     def has_template(self, uri):
#     def get_template(self, uri, relativeto=None):
#     def filename_to_uri(self, uri, filename):
#     def adjust_uri(self, uri, filename):
#     def __init__(
#         self,
#         directories=None,
#         module_directory=None,
#         filesystem_checks=True,
#         collection_size=-1,
#         format_exceptions=False,
#         error_handler=None,
#         output_encoding=None,
#         encoding_errors="strict",
#         cache_args=None,
#         cache_impl="beaker",
#         cache_enabled=True,
#         cache_type=None,
#         cache_dir=None,
#         cache_url=None,
#         modulename_callable=None,
#         module_writer=None,
#         default_filters=None,
#         buffer_filters=(),
#         strict_undefined=False,
#         imports=None,
#         future_imports=None,
#         enable_loop=True,
#         input_encoding=None,
#         preprocessor=None,
#         lexer_cls=None,
#         include_error_handler=None,
#     ):
#     def get_template(self, uri):
#     def adjust_uri(self, uri, relativeto):
#     def filename_to_uri(self, filename):
#     def _relativeize(self, filename):
#     def _load(self, filename, uri):
#     def _check(self, uri, template):
#     def put_string(self, uri, text):
#     def put_template(self, uri, template):
# 
# Path: mako/testing/helpers.py
# def result_lines(result):
#     return [
#         x.strip()
#         for x in re.split(r"\r?\n", re.sub(r" +", " ", result))
#         if x.strip() != ""
#     ]


# Path: test/test_inheritance.py
from mako import lookup
from mako.testing.helpers import result_lines

${parent.d()}
${parent.context['parent'].d()}
${next.body()}
""",
        )

        collection.put_string(
            "general",
            """
<%inherit file="base"/>
<%def name="d()">general_d</%def>
general_body
${next.d()}
${next.context['next'].d()}
${next.body()}
""",
        )
        collection.put_string(
            "base",
            """
base_body
full stack from the base:
    ${self.name} ${self.context['parent'].name} """
            """${self.context['parent'].context['parent'].name} """
            """${self.context['parent'].context['parent'].context['parent'].name}
${next.body()}
<%def name="d()">base_d</%def>
""",
        )


        assert result_lines(collection.get_template("main").render()) == [