# Path: flatland/schema/scalars.py
# class String(Scalar):
#     """A regular old Unicode string."""
# 
#     strip = True
#     """If true, strip leading and trailing whitespace during conversion."""
# 
#     def adapt(self, value):
#         """Return a Unicode representation.
# 
#         :returns: a ``unicode`` value or ``None``
# 
#         If :attr:`strip` is true, leading and trailing whitespace will be
#         removed.
# 
#         """
#         if value is None:
#             return None
#         elif self.strip:
#             return unicode(value).strip()
#         else:
#             return unicode(value)
# 
#     def serialize(self, value):
#         """Return a Unicode representation.
# 
#         :returns: a ``unicode`` value or ``u'' if *value* is ``None``
# 
#         If :attr:`strip` is true, leading and trailing whitespace will be
#         removed.
# 
#         """
#         if value is None:
#             return u''
#         elif self.strip:
#             return unicode(value).strip()
#         else:
#             return unicode(value)
# 
#     @property
#     def is_empty(self):
#         """True if the String is missing or has no value."""
#         return True if (not self.value and self.u == u'') else False
# 
# 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 flatland import String
from tests._util import fails
from tests.markup._util import desired_output


@value_bound.markup
def test_value_bound_markup(gen, el):
    return gen.tag('div', el, auto_value=True)


@desired_output('html', None)
def value_unbound():
    """<div></div>"""


@value_unbound.genshi_06
def test_value_unbound_genshi_06():
    """<div form:auto-value="on" />"""


@value_unbound.genshi_05
def test_value_unbound_genshi_05():
    """<div form:auto-value="on" />"""


@value_unbound.markup
def test_value_unbound_markup(gen, el):
    return gen.tag('div', auto_value=True)


### name



# Path: flatland/schema/scalars.py
# class String(Scalar):
#     """A regular old Unicode string."""
# 
#     strip = True
#     """If true, strip leading and trailing whitespace during conversion."""
# 
#     def adapt(self, value):
#         """Return a Unicode representation.
# 
#         :returns: a ``unicode`` value or ``None``
# 
#         If :attr:`strip` is true, leading and trailing whitespace will be
#         removed.
# 
#         """
#         if value is None:
#             return None
#         elif self.strip:
#             return unicode(value).strip()
#         else:
#             return unicode(value)
# 
#     def serialize(self, value):
#         """Return a Unicode representation.
# 
#         :returns: a ``unicode`` value or ``u'' if *value* is ``None``
# 
#         If :attr:`strip` is true, leading and trailing whitespace will be
#         removed.
# 
#         """
#         if value is None:
#             return u''
#         elif self.strip:
#             return unicode(value).strip()
#         else:
#             return unicode(value)
# 
#     @property
#     def is_empty(self):
#         """True if the String is missing or has no value."""
#         return True if (not self.value and self.u == u'') else False
# 
# 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_forcing.py
from flatland import String
from tests._util import fails
from tests.markup._util import desired_output



@value_bound.markup
def test_value_bound_markup(gen, el):
    return gen.tag('div', el, auto_value=True)


@desired_output('html', None)
def value_unbound():
    """<div></div>"""


@value_unbound.genshi_06
def test_value_unbound_genshi_06():
    """<div form:auto-value="on" />"""


@value_unbound.genshi_05
def test_value_unbound_genshi_05():
    """<div form:auto-value="on" />"""


@value_unbound.markup
def test_value_unbound_markup(gen, el):
    return gen.tag('div', auto_value=True)


### name



@desired_output('html', schema)