def test_markup(): assert Markup(html.a(name='value')(html.b(first='one'), 'Text', html.c())) == '<a name="value"><b first="one" />Text<c></c></a>' assert Markup(html.p(html.comment('Comment'))) == '<p><!--Comment--></p>' assert Markup(html.p(html.safe('<strong> Text </strong>'))) == '<p><strong> Text </strong></p>' assert Markup(html.safe('<strong> Text </strong>')) == '<strong> Text </strong>' assert rn(html.p(Markup('<strong> Text </strong>'))) == '<p><strong> Text </strong></p>' assert rn(html.p(Markup(' '), Markup('<strong>One</strong>'))) == '<p> <strong>One</strong></p>' assert render(html.p(Markup(' '), Markup('<strong>One</strong>'))) == u'<p>\n \n <strong>One</strong>\n</p>\n'
def test_markup(): assert Markup(html.a(name='value')( html.b(first='one'), 'Text', html.c())) == '<a name="value"><b first="one" />Text<c></c></a>' assert Markup(html.p(html.comment('Comment'))) == '<p><!--Comment--></p>' assert Markup(html.p(html.safe('<strong> Text </strong>')) ) == '<p><strong> Text </strong></p>' assert Markup(html.safe('<strong> Text </strong>') ) == '<strong> Text </strong>' assert rn(html.p(Markup('<strong> Text </strong>')) ) == '<p><strong> Text </strong></p>' assert rn(html.p(Markup(' '), Markup( '<strong>One</strong>'))) == '<p> <strong>One</strong></p>' assert render(html.p(Markup(' '), Markup('<strong>One</strong>')) ) == u'<p>\n \n <strong>One</strong>\n</p>\n'
def test_many_child_indenting(): assert render(html.a(name='value')(html.b(first='one'), 'Text', html.c())) == '<a name="value">\n <b first="one" />\n Text\n <c></c>\n</a>\n'
def test_nesting(): assert rn(html.a(name='value')(html.b('Text'), html.c(html.d, html.e()))) == '<a name="value"><b>Text</b><c><d /><e></e></c></a>'
def test_many_children(): assert rn(html.a(name='value')(html.b(first='one'), 'Text', html.c())) == '<a name="value"><b first="one" />Text<c></c></a>'
def test_iteratable_render(): assert rn([html.a, 'Text', html.b()]) == '<a />Text<b></b>' assert rn(html.c([html.a, 'Text', html.b()])) == '<c><a />Text<b></b></c>'
def test_many_child_indenting(): assert render(html.a(name='value')(html.b(first='one'), 'Text', html.c( ))) == '<a name="value">\n <b first="one" />\n Text\n <c></c>\n</a>\n'
def test_nesting(): assert rn(html.a(name='value')(html.b('Text'), html.c( html.d, html.e()))) == '<a name="value"><b>Text</b><c><d /><e></e></c></a>'
def test_many_children(): assert rn(html.a(name='value')( html.b(first='one'), 'Text', html.c())) == '<a name="value"><b first="one" />Text<c></c></a>'