#! /usr/bin/env/python # -*- coding: iso-8859-1 -*- ## Copyright 1999-2006 by LivingLogic AG, Bayreuth/Germany. ## Copyright 1999-2006 by Walter Dörwald ## ## All Rights Reserved ## ## See xist/__init__.py for the license from ll.xist import xsc from ll.xist.ns import html, php def test_pretty(): def check(node, result): assert node.pretty().asBytes() == result tests = [ (html.p("apple", "tree"), "

appletree

"), (html.p("apple", html.br(), "tree"), "

apple
tree

"), (html.p(php.php("apple")), "

\n\t\n

"), (html.p(php.php("apple"), "tree"), "

tree

"), ( html.div(2*html.p("apple", "tree"), html.br()), "
\n\t

appletree

\n\t

appletree

\n\t
\n
" ), ( html.div( php.php("apple"), html.p("apple", "tree"), html.div( html.p("apple"), html.p("tree"), ), html.br() ), "
\n\t\n\t

appletree

\n\t
\n\t\t

apple

\n\t\t

tree

\n\t
\n\t
\n
" ), ] for (got, exp) in tests: yield check, got, exp