def test_implicit_newline_colon(): expandstr("foo {{tt}}", "foo \n:", wikidb=DictDB(tt=":"))
def test_implicit_newline_includeonly(): expandstr("foo {{tt}}", "foo \n{|", wikidb=DictDB(tt="<includeonly>{|</includeonly>"))
def test_implicit_newline_begintable(): expandstr("foo {{tt}}", "foo \n{|", wikidb=DictDB(tt="{|"))
def test_parser_func_from_template(): expandstr("{{ {{bla}} 1 + 1}}", "2", wikidb=DictDB(bla="#expr:"))
def test_implicit_newline_noinclude(): expandstr("foo {{tt}}", "foo \n{|", wikidb=DictDB(tt="<noinclude></noinclude>{|"))
def test_expand_name_with_colon(): wikidb = DictDB() wikidb.d['bla:blubb'] = 'foo' expandstr("{{bla:blubb}}", "foo", wikidb=wikidb)
def test_expand_parser_func_name(): expandstr("{{ {{NZ}}expr: 1+1}}", "2", wikidb=DictDB(NZ="#"))
def test_named_variable_whitespace(): """http://code.pediapress.com/wiki/ticket/23""" expandstr("{{doit|notable roles=these are the notable roles}}", "these are the notable roles", wikidb=DictDB(doit="{{{notable roles}}}"))
def test_noexpansion_inside_pre(): res = expandstr("<pre>A{{Pipe}}B</pre>", "<pre>A{{Pipe}}B</pre>", wikidb=DictDB(Pipe="C")) print res
def test_tag_expand_vs_uniq(): db = DictDB(Foo="""{{#tag:pre|inside pre}}""") r = uparser.parseString(title="Foo", wikidb=db) core.show(r) pre = r.find(parser.PreFormatted) assert len(pre) == 1, "expected a preformatted node"