# Path: mako/lookup.py
# class TemplateCollection(object):
# 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, 
#                         disable_unicode=False, 
#                         output_encoding=None, 
#                         encoding_errors='strict', 
#                         cache_type=None, 
#                         cache_dir=None, cache_url=None,
#                         cache_enabled=True, 
#                         modulename_callable=None, 
#                         default_filters=None, 
#                         buffer_filters=(), 
#                         imports=None, 
#                         input_encoding=None, 
#                         preprocessor=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):


from mako.template import Template
from mako import lookup
from util import flatten_result, result_lines
import unittest
        </%def>
        ${enclosing()}
    """)
        assert flatten_result(t.render(x=5)) == "b. x is 10. a: x is 5"

    def test_scope_eight(self):
        """test that the initial context counts as 'enclosing' scope, for nested defs"""
        t = Template("""
        <%def name="enclosing()">
            <%def name="a()">
                a: x is ${x}
            </%def>

            <%def name="b()">
                <%
                    x = 10
                %>
                
                b. x is ${x}.  ${a()}
            </%def>

            ${b()}
        </%def>
        ${enclosing()}
    """)
        assert flatten_result(t.render(x=5)) == "b. x is 10. a: x is 5"

    def test_scope_nine(self):
        """test that 'enclosing scope' doesnt get exported to other templates"""
        

# Path: mako/lookup.py
# class TemplateCollection(object):
# 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, 
#                         disable_unicode=False, 
#                         output_encoding=None, 
#                         encoding_errors='strict', 
#                         cache_type=None, 
#                         cache_dir=None, cache_url=None,
#                         cache_enabled=True, 
#                         modulename_callable=None, 
#                         default_filters=None, 
#                         buffer_filters=(), 
#                         imports=None, 
#                         input_encoding=None, 
#                         preprocessor=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: test/test_def.py
from mako.template import Template
from mako import lookup
from util import flatten_result, result_lines
import unittest

        </%def>
        ${enclosing()}
    """)
        assert flatten_result(t.render(x=5)) == "b. x is 10. a: x is 5"

    def test_scope_eight(self):
        """test that the initial context counts as 'enclosing' scope, for nested defs"""
        t = Template("""
        <%def name="enclosing()">
            <%def name="a()">
                a: x is ${x}
            </%def>

            <%def name="b()">
                <%
                    x = 10
                %>
                
                b. x is ${x}.  ${a()}
            </%def>

            ${b()}
        </%def>
        ${enclosing()}
    """)
        assert flatten_result(t.render(x=5)) == "b. x is 10. a: x is 5"

    def test_scope_nine(self):
        """test that 'enclosing scope' doesnt get exported to other templates"""
        

        l = lookup.TemplateLookup()