# Path: tests/genshi/_util.py
# class FilteredRenderTest(RenderTest):
#     def generate(self, template, context):
#         from flatland.out.genshi import flatland_filter
#         return flatland_filter(template.generate(context), context)
# 
# class RenderTest(TextFileMixin):
#     format = 'xhtml'
#     debug = False
# 
#     def compile(self, template_text):
#         import genshi.template
#         return genshi.template.MarkupTemplate(template_text)
# 
#     def to_genshi_context(self, context):
#         import genshi.template
#         if not isinstance(context, genshi.template.Context):
#             return genshi.template.Context(**context)
#         return context
# 
#     def generate(self, template, context):
#         return template.generate(context)
# 
#     def render(self, stream, format=None):
#         if format is None:
#             format = self.format
#         return stream.render(format)
# 
#     def compare_(self, context, template_text):
#         chunked_raw = chunk_assertion_blocks(template_text)
#         if not chunked_raw:
#             raise AssertionError("No test chunks found in template text.")
# 
#         template = self.compile(template_text)
#         genshi_context = self.to_genshi_context(context)
#         stream = self.generate(template, genshi_context)
#         output = self.render(stream)
#         if self.debug:
#             print template_text
#             print output
# 
#         chunked_output = chunk_assertion_blocks(output)
# 
#         try:
#             for idx, label, lhs, rhs in chunked_output:
#                 assert lhs == rhs, "test %s: %r != %r" % (label, lhs, rhs)
# 
#             eq_(len(chunked_raw), len(chunked_output))
#         except:
#             print output
#             raise
# 
# def from_docstring(context_factory=dict):
#     def wrap(fn):
#         def test(self, *args, **kw):
#             tests = self.from_string(fn.__doc__, context_factory,
#                                      name=fn.func_name)
#             for test, context, template in tests:
#                 yield test, context, template
#         test.func_name = fn.func_name
#         return test
#     return wrap


from tests.genshi._util import (
    FilteredRenderTest,
    RenderTest,
    from_docstring,
    )
False
True
Maybe
False
::endtest

:: test
<form:with auto-domid="on">
${value_of('auto-domid')}
<div id="${value_of('auto-domid')}" />
</form:with>
:: eq
True
<div id="True" />
:: endtest

:: test
<form:with auto-domid="true">
  <py:if test="value_of('auto-domid')">
  defined
  </py:if>
  <py:if test="not value_of('auto-domid')">
  not defined
  </py:if>
</form:with>
:: eq
  defined
:: endtest
    """


# Path: tests/genshi/_util.py
# class FilteredRenderTest(RenderTest):
#     def generate(self, template, context):
#         from flatland.out.genshi import flatland_filter
#         return flatland_filter(template.generate(context), context)
# 
# class RenderTest(TextFileMixin):
#     format = 'xhtml'
#     debug = False
# 
#     def compile(self, template_text):
#         import genshi.template
#         return genshi.template.MarkupTemplate(template_text)
# 
#     def to_genshi_context(self, context):
#         import genshi.template
#         if not isinstance(context, genshi.template.Context):
#             return genshi.template.Context(**context)
#         return context
# 
#     def generate(self, template, context):
#         return template.generate(context)
# 
#     def render(self, stream, format=None):
#         if format is None:
#             format = self.format
#         return stream.render(format)
# 
#     def compare_(self, context, template_text):
#         chunked_raw = chunk_assertion_blocks(template_text)
#         if not chunked_raw:
#             raise AssertionError("No test chunks found in template text.")
# 
#         template = self.compile(template_text)
#         genshi_context = self.to_genshi_context(context)
#         stream = self.generate(template, genshi_context)
#         output = self.render(stream)
#         if self.debug:
#             print template_text
#             print output
# 
#         chunked_output = chunk_assertion_blocks(output)
# 
#         try:
#             for idx, label, lhs, rhs in chunked_output:
#                 assert lhs == rhs, "test %s: %r != %r" % (label, lhs, rhs)
# 
#             eq_(len(chunked_raw), len(chunked_output))
#         except:
#             print output
#             raise
# 
# def from_docstring(context_factory=dict):
#     def wrap(fn):
#         def test(self, *args, **kw):
#             tests = self.from_string(fn.__doc__, context_factory,
#                                      name=fn.func_name)
#             for test, context, template in tests:
#                 yield test, context, template
#         test.func_name = fn.func_name
#         return test
#     return wrap


# Path: tests/genshi/test_context.py
from tests.genshi._util import (
    FilteredRenderTest,
    RenderTest,
    from_docstring,
    )

False
True
Maybe
False
::endtest

:: test
<form:with auto-domid="on">
${value_of('auto-domid')}
<div id="${value_of('auto-domid')}" />
</form:with>
:: eq
True
<div id="True" />
:: endtest

:: test
<form:with auto-domid="true">
  <py:if test="value_of('auto-domid')">
  defined
  </py:if>
  <py:if test="not value_of('auto-domid')">
  not defined
  </py:if>
</form:with>
:: eq
  defined
:: endtest
    """


    @from_docstring()