# Path: genshi/template/directives.py
# class DirectiveMeta(type):
# class Directive(object):
# class AttrsDirective(Directive):
# class ContentDirective(Directive):
# class DefDirective(Directive):
# class ForDirective(Directive):
# class IfDirective(Directive):
# class MatchDirective(Directive):
# class ReplaceDirective(Directive):
# class StripDirective(Directive):
# class ChooseDirective(Directive):
# class WhenDirective(Directive):
# class OtherwiseDirective(Directive):
# class WithDirective(Directive):
#     def __new__(cls, name, bases, d):
#     def __init__(self, value, template=None, namespaces=None, lineno=-1,
#                  offset=-1):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __repr__(self):
#     def _parse_expr(cls, expr, template, lineno=-1, offset=-1):
# def _assignment(ast):
#     def _names(node):
#     def _assign(data, value, names=_names(ast)):
#     def __call__(self, stream, directives, ctxt, **vars):
#         def _generate():
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __init__(self, args, template, namespaces=None, lineno=-1, offset=-1):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#         def function(*args, **kwargs):
#     def __repr__(self):
#     def __init__(self, value, template, namespaces=None, lineno=-1, offset=-1):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __repr__(self):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __init__(self, value, template, hints=None, namespaces=None,
#                  lineno=-1, offset=-1):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __repr__(self):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#         def _generate():
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __init__(self, value, template, namespaces=None, lineno=-1, offset=-1):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __init__(self, value, template, namespaces=None, lineno=-1, offset=-1):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __init__(self, value, template, namespaces=None, lineno=-1, offset=-1):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __repr__(self):


import doctest
import re
import sys
import unittest
from genshi.template import directives, MarkupTemplate, TextTemplate, \
                            TemplateRuntimeError, TemplateSyntaxError
          <span>
            42
          </span>
        </div>""", tmpl.generate(foo={'bar': 42}).render(encoding=None))

    def test_unicode_expr(self):
        tmpl = MarkupTemplate(u"""<div xmlns:py="http://genshi.edgewall.org/">
          <span py:with="weeks=(u'一', u'二', u'三', u'四', u'五', u'六', u'日')">
            $weeks
          </span>
        </div>""")
        self.assertEqual(u"""<div>
          <span>
            一二三四五六日
          </span>
        </div>""", tmpl.generate().render(encoding=None))
        
    def test_with_empty_value(self):
        """
        Verify that an empty py:with works (useless, but legal)
        """
        tmpl = MarkupTemplate("""<div xmlns:py="http://genshi.edgewall.org/">
          <span py:with="">Text</span></div>""")

        self.assertEqual("""<div>
          <span>Text</span></div>""", tmpl.generate().render(encoding=None))


def suite():
    suite = unittest.TestSuite()

# Path: genshi/template/directives.py
# class DirectiveMeta(type):
# class Directive(object):
# class AttrsDirective(Directive):
# class ContentDirective(Directive):
# class DefDirective(Directive):
# class ForDirective(Directive):
# class IfDirective(Directive):
# class MatchDirective(Directive):
# class ReplaceDirective(Directive):
# class StripDirective(Directive):
# class ChooseDirective(Directive):
# class WhenDirective(Directive):
# class OtherwiseDirective(Directive):
# class WithDirective(Directive):
#     def __new__(cls, name, bases, d):
#     def __init__(self, value, template=None, namespaces=None, lineno=-1,
#                  offset=-1):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __repr__(self):
#     def _parse_expr(cls, expr, template, lineno=-1, offset=-1):
# def _assignment(ast):
#     def _names(node):
#     def _assign(data, value, names=_names(ast)):
#     def __call__(self, stream, directives, ctxt, **vars):
#         def _generate():
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __init__(self, args, template, namespaces=None, lineno=-1, offset=-1):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#         def function(*args, **kwargs):
#     def __repr__(self):
#     def __init__(self, value, template, namespaces=None, lineno=-1, offset=-1):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __repr__(self):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __init__(self, value, template, hints=None, namespaces=None,
#                  lineno=-1, offset=-1):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __repr__(self):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#         def _generate():
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __init__(self, value, template, namespaces=None, lineno=-1, offset=-1):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __init__(self, value, template, namespaces=None, lineno=-1, offset=-1):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __init__(self, value, template, namespaces=None, lineno=-1, offset=-1):
#     def attach(cls, template, stream, value, namespaces, pos):
#     def __call__(self, stream, directives, ctxt, **vars):
#     def __repr__(self):


# Path: genshi/template/tests/directives.py
import doctest
import re
import sys
import unittest
from genshi.template import directives, MarkupTemplate, TextTemplate, \
                            TemplateRuntimeError, TemplateSyntaxError

          <span>
            42
          </span>
        </div>""", tmpl.generate(foo={'bar': 42}).render(encoding=None))

    def test_unicode_expr(self):
        tmpl = MarkupTemplate(u"""<div xmlns:py="http://genshi.edgewall.org/">
          <span py:with="weeks=(u'一', u'二', u'三', u'四', u'五', u'六', u'日')">
            $weeks
          </span>
        </div>""")
        self.assertEqual(u"""<div>
          <span>
            一二三四五六日
          </span>
        </div>""", tmpl.generate().render(encoding=None))
        
    def test_with_empty_value(self):
        """
        Verify that an empty py:with works (useless, but legal)
        """
        tmpl = MarkupTemplate("""<div xmlns:py="http://genshi.edgewall.org/">
          <span py:with="">Text</span></div>""")

        self.assertEqual("""<div>
          <span>Text</span></div>""", tmpl.generate().render(encoding=None))


def suite():
    suite = unittest.TestSuite()

    suite.addTest(doctest.DocTestSuite(directives))