# Path: tests/markup/_util.py
# def alternate_expectation(backend, string):
#     def decorator(fn):
#         try:
#             alternates = fn.alternates
#         except AttributeError:
#             alternates = fn.alternates = {}
#         alternates[backend] = string.strip()
#         return fn
#     return decorator
# 
# class desired_output(object):
# 
#     def __init__(self, language, schema, **kw):
#         self.language = language
#         self.schema = schema
#         self.expected = None
#         self.alternate_expectations = {}
#         self.render_context = kw
# 
#     def __call__(self, fn):
#         self.expected = fn.__doc__.strip()
#         self.alternate_expectations = getattr(fn, 'alternates', {})
#         return self
# 
#     def expectation_for(self, backend):
#         try:
#             return self.alternate_expectations[backend]
#         except KeyError:
#             return self.expected
# 
#     @property
#     def genshi_06(self):
#         def decorator(fn):
#             markup = _wrap_with_xmlns(fn.__doc__, self.language)
#             fn.__doc__ = None
#             @wraps(fn)
#             def runner():
#                 if not have['genshi_06']:
#                     raise SkipTest
#                 got = _render_genshi_06(markup, self.language, self.schema,
#                                         **self.render_context)
#                 expected = self.expectation_for('genshi_06')
#                 if expected != got:
#                     print "\n" + fn.__name__
#                     print "Expected:\n" + expected
#                     print "Got:\n" + got
#                 assert expected == got
#             return runner
#         return decorator
# 
#     @property
#     def genshi_05(self):
#         def decorator(fn):
#             markup = _wrap_with_xmlns(fn.__doc__, self.language)
#             fn.__doc__ = None
#             @wraps(fn)
#             def runner():
#                 if not have['genshi_05']:
#                     raise SkipTest
#                 got = _render_genshi_05(markup, self.language, self.schema,
#                                         **self.render_context)
#                 expected = self.expectation_for('genshi_05')
#                 if expected != got:
#                     print "\n" + fn.__name__
#                     print "Expected:\n" + expected
#                     print "Got:\n" + got
#                 assert expected == got
#             return runner
#         return decorator
# 
#     @property
#     def markup(self):
#         def decorator(fn):
#             @wraps(fn)
#             def runner():
#                 got = _render_markup_fn(fn, self.language, self.schema,
#                                         **self.render_context)
#                 expected = self.expectation_for('markup')
#                 if expected != got:
#                     print "\n" + fn.__name__
#                     print "Expected:\n" + expected
#                     print "Got:\n" + got
#                 assert expected == got
#             return runner
#         return decorator


from tests.markup._util import alternate_expectation, desired_output
    from flatland import Form, String
def test_element_domid_auto_genshi_05():
    """
    <form:with auto-domid="on" domid-format="-%s-">
      <select form:bind="${form.valued.bind}" form:auto-domid="auto"/>
    </form:with>
    """


@domid_enabled.markup
def test_element_domid_auto_markup(gen, el):
    gen.begin(auto_domid=True, domid_format="-%s-")
    output = gen.select(el['valued'], auto_domid="auto")
    gen.end()
    return output

### for


### tabindex

### filter


def filter1(tagname, attributes, contents, context, bind):
    attributes['class'] = 'required'
    contents += ' *'

    return contents



# Path: tests/markup/_util.py
# def alternate_expectation(backend, string):
#     def decorator(fn):
#         try:
#             alternates = fn.alternates
#         except AttributeError:
#             alternates = fn.alternates = {}
#         alternates[backend] = string.strip()
#         return fn
#     return decorator
# 
# class desired_output(object):
# 
#     def __init__(self, language, schema, **kw):
#         self.language = language
#         self.schema = schema
#         self.expected = None
#         self.alternate_expectations = {}
#         self.render_context = kw
# 
#     def __call__(self, fn):
#         self.expected = fn.__doc__.strip()
#         self.alternate_expectations = getattr(fn, 'alternates', {})
#         return self
# 
#     def expectation_for(self, backend):
#         try:
#             return self.alternate_expectations[backend]
#         except KeyError:
#             return self.expected
# 
#     @property
#     def genshi_06(self):
#         def decorator(fn):
#             markup = _wrap_with_xmlns(fn.__doc__, self.language)
#             fn.__doc__ = None
#             @wraps(fn)
#             def runner():
#                 if not have['genshi_06']:
#                     raise SkipTest
#                 got = _render_genshi_06(markup, self.language, self.schema,
#                                         **self.render_context)
#                 expected = self.expectation_for('genshi_06')
#                 if expected != got:
#                     print "\n" + fn.__name__
#                     print "Expected:\n" + expected
#                     print "Got:\n" + got
#                 assert expected == got
#             return runner
#         return decorator
# 
#     @property
#     def genshi_05(self):
#         def decorator(fn):
#             markup = _wrap_with_xmlns(fn.__doc__, self.language)
#             fn.__doc__ = None
#             @wraps(fn)
#             def runner():
#                 if not have['genshi_05']:
#                     raise SkipTest
#                 got = _render_genshi_05(markup, self.language, self.schema,
#                                         **self.render_context)
#                 expected = self.expectation_for('genshi_05')
#                 if expected != got:
#                     print "\n" + fn.__name__
#                     print "Expected:\n" + expected
#                     print "Got:\n" + got
#                 assert expected == got
#             return runner
#         return decorator
# 
#     @property
#     def markup(self):
#         def decorator(fn):
#             @wraps(fn)
#             def runner():
#                 got = _render_markup_fn(fn, self.language, self.schema,
#                                         **self.render_context)
#                 expected = self.expectation_for('markup')
#                 if expected != got:
#                     print "\n" + fn.__name__
#                     print "Expected:\n" + expected
#                     print "Got:\n" + got
#                 assert expected == got
#             return runner
#         return decorator


# Path: tests/markup/test_tag_context.py
from tests.markup._util import alternate_expectation, desired_output
    from flatland import Form, String

def test_element_domid_auto_genshi_05():
    """
    <form:with auto-domid="on" domid-format="-%s-">
      <select form:bind="${form.valued.bind}" form:auto-domid="auto"/>
    </form:with>
    """


@domid_enabled.markup
def test_element_domid_auto_markup(gen, el):
    gen.begin(auto_domid=True, domid_format="-%s-")
    output = gen.select(el['valued'], auto_domid="auto")
    gen.end()
    return output

### for


### tabindex

### filter


def filter1(tagname, attributes, contents, context, bind):
    attributes['class'] = 'required'
    contents += ' *'

    return contents



@desired_output('xhtml', simple_schema, funky_filter=filter1)