def test_cond_markup(s): pat = XMLFromPattern(r'<title|\<b\><title> woo\</b\>>') s.assertEquals(pat.format(s.a), '<b>Title5 woo</b>')
def test_escape(s): pat = XMLFromPattern(r'\<b\><<xmltest>>\</b\>') s.assertEquals(pat.format(s.a), '<b><<&>></b>')
def test_markup_passthrough(s): pat = XMLFromPattern(r'\<b\><<title>>\</b\>') s.assertEquals(pat.format(s.a), '<b><Title5></b>') s.assertEquals(pat.format(s.b), '<b><Title6></b>') s.assertEquals(pat.format(s.c), '<b><test/subdir></b>')