Mercurial > genshi > mirror
diff examples/trac/trac/wiki/tests/macros.py @ 39:93b4dcbafd7b trunk
Copy Trac to main branch.
author | cmlenz |
---|---|
date | Mon, 03 Jul 2006 18:53:27 +0000 |
parents | |
children |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/examples/trac/trac/wiki/tests/macros.py @@ -0,0 +1,45 @@ +import unittest + +import trac.wiki.macros +from trac.wiki.tests import formatter + +IMAGE_MACRO_TEST_CASES=u""" +============================== source: Image, no other arguments +[[Image(source:test.png)]] +------------------------------ +<p> +<a style="padding:0; border:none" href="/browser/test.png"><img src="/browser/test.png?format=raw" alt="source:test.png" title="source:test.png" /></a> +</p> +------------------------------ +[[Image(...)]] +============================== source: Image, nolink +[[Image(source:test.png, nolink)]] +------------------------------ +<p> +<img src="/browser/test.png?format=raw" alt="source:test.png" title="source:test.png" /> +</p> +------------------------------ +============================== source: Image, normal args +[[Image(source:test.png, align=left, title=Test)]] +------------------------------ +<p> +<a style="padding:0; border:none" href="/browser/test.png"><img src="/browser/test.png?format=raw" alt="source:test.png" style="float:left" title="Test" /></a> +</p> +------------------------------ +============================== source: Image, size arg +[[Image(source:test.png, 30%)]] +------------------------------ +<p> +<a style="padding:0; border:none" href="/browser/test.png"><img width="30%" alt="source:test.png" src="/browser/test.png?format=raw" title="source:test.png" /></a> +</p> +------------------------------ +""" + + +def suite(): + suite = unittest.TestSuite() + suite.addTest(formatter.suite(IMAGE_MACRO_TEST_CASES, file=__file__)) + return suite + +if __name__ == '__main__': + unittest.main(defaultTest='suite')