# Path: tests/markup/_util.py
# 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 desired_output
    from flatland import Form, String

@input_value_html.markup
def test_input_value_html_markup(gen, el):
    return gen.input(el['valued'])

###


@desired_output('xhtml', simple_schema)
def input_value_xhtml():
    """<input name="valued" value="val" />"""


@input_value_xhtml.genshi_06
def test_input_value_xhtml_genshi_06():
    """<input form:bind="form.valued"/>"""


@input_value_xhtml.genshi_05
def test_input_value_xhtml_genshi_05():
    """<input form:bind="${form.valued.bind}"/>"""


@input_value_xhtml.markup
def test_input_value_xhtml_markup(gen, el):
    return gen.input(el['valued'])

###



# Path: tests/markup/_util.py
# 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_pairing.py
from tests.markup._util import desired_output
    from flatland import Form, String


@input_value_html.markup
def test_input_value_html_markup(gen, el):
    return gen.input(el['valued'])

###


@desired_output('xhtml', simple_schema)
def input_value_xhtml():
    """<input name="valued" value="val" />"""


@input_value_xhtml.genshi_06
def test_input_value_xhtml_genshi_06():
    """<input form:bind="form.valued"/>"""


@input_value_xhtml.genshi_05
def test_input_value_xhtml_genshi_05():
    """<input form:bind="${form.valued.bind}"/>"""


@input_value_xhtml.markup
def test_input_value_xhtml_markup(gen, el):
    return gen.input(el['valued'])

###



@desired_output('xhtml', simple_schema)