changeset 2533:cb0b32c2064f

Adds test for resize transclusions (moinwiki converter)
author sharky93 <rishabhr123@gmail.com>
date Mon, 22 Jul 2013 04:20:37 +0530
parents 74d2eafffa29
children 6b7e6f43de4a
files MoinMoin/converter/_tests/test_moinwiki_in.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/_tests/test_moinwiki_in.py	Mon Jul 22 04:19:16 2013 +0530
+++ b/MoinMoin/converter/_tests/test_moinwiki_in.py	Mon Jul 22 04:20:37 2013 +0530
@@ -10,7 +10,7 @@
 
 import re
 
-from MoinMoin.util.tree import moin_page, xlink
+from MoinMoin.util.tree import moin_page, xlink, html, xinclude
 
 from MoinMoin.converter.moinwiki_in import Converter
 
@@ -19,6 +19,8 @@
     namespaces = {
         moin_page: '',
         xlink: 'xlink',
+        html: 'xhtml',
+        xinclude: 'xinclude',
     }
 
     output_re = re.compile(r'\s+xmlns(:\S+)?="[^"]+"')
@@ -42,6 +44,12 @@
                 '<page><body><p><a xlink:href="http://moinmo.in/">MoinMoin</a></p></body></page>'),
             (u'[[MoinMoin]]',
                 '<page><body><p><a xlink:href="wiki.local:MoinMoin">MoinMoin</a></p></body></page>'),
+            (u'{{somelocalimage||width=10, height=10}}',
+                '<page><body><p><xinclude:include xhtml:height="10" xhtml:width="10" xinclude:href="wiki.local:somelocalimage?" /></p></body></page>'),
+            (u'{{somelocalimage||width=10, &h=10}}',
+                '<page><body><p><xinclude:include xhtml:width="10" xinclude:href="wiki.local:somelocalimage?h=10" /></p></body></page>'),
+            (u'{{http://moinmo.in/|test|width=10, height=10}}',
+                '<page><body><p><object alt="test" xhtml:height="10" xhtml:width="10" xlink:href="http://moinmo.in/">test</object></p></body></page>'),
             (u'{{http://moinmo.in/}}',
                 '<page><body><p><object xlink:href="http://moinmo.in/" /></p></body></page>', None, 'unknown'),
             (u'{{http://moinmo.in/|MoinMoin}}',