Beispiel #1
0
def test_implicit_newline_colon():
    expandstr("foo {{tt}}", "foo \n:", wikidb=DictDB(tt=":"))
Beispiel #2
0
def test_implicit_newline_includeonly():
    expandstr("foo {{tt}}",
              "foo \n{|",
              wikidb=DictDB(tt="<includeonly>{|</includeonly>"))
Beispiel #3
0
def test_implicit_newline_begintable():
    expandstr("foo {{tt}}", "foo \n{|", wikidb=DictDB(tt="{|"))
Beispiel #4
0
def test_parser_func_from_template():
    expandstr("{{ {{bla}} 1 + 1}}", "2", wikidb=DictDB(bla="#expr:"))
Beispiel #5
0
def test_implicit_newline_noinclude():
    expandstr("foo {{tt}}",
              "foo \n{|",
              wikidb=DictDB(tt="<noinclude></noinclude>{|"))
Beispiel #6
0
def test_expand_name_with_colon():
    wikidb = DictDB()
    wikidb.d['bla:blubb'] = 'foo'
    expandstr("{{bla:blubb}}", "foo", wikidb=wikidb)
Beispiel #7
0
def test_expand_parser_func_name():
    expandstr("{{ {{NZ}}expr: 1+1}}", "2", wikidb=DictDB(NZ="#"))
Beispiel #8
0
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}}}"))
Beispiel #9
0
def test_noexpansion_inside_pre():
    res = expandstr("<pre>A{{Pipe}}B</pre>",
                    "<pre>A{{Pipe}}B</pre>",
                    wikidb=DictDB(Pipe="C"))
    print res
Beispiel #10
0
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"