changeset 2574:6baafd9876d0

fix tests broken by adding toc extension to markdown - creates IDs on heading lines
author RogerHaase <haaserd@gmail.com>
date Mon, 10 Mar 2014 14:33:42 -0700
parents a9dba78d47b2
children d6217164b1f0
files MoinMoin/converter/_tests/test_markdown_in.py
diffstat 1 files changed, 18 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/_tests/test_markdown_in.py	Mon Mar 10 14:28:29 2014 -0700
+++ b/MoinMoin/converter/_tests/test_markdown_in.py	Mon Mar 10 14:33:42 2014 -0700
@@ -9,7 +9,7 @@
 
 import re
 
-from MoinMoin.util.tree import moin_page, xlink
+from MoinMoin.util.tree import moin_page, xlink, xml
 
 from ..markdown_in import Converter
 
@@ -18,6 +18,7 @@
     namespaces = {
         moin_page: '',
         xlink: 'xlink',
+        xml: 'xml',
     }
 
     output_re = re.compile(r'\s+xmlns(:\S+)?="[^"]+"')
@@ -76,35 +77,35 @@
     def test_heading(self):
         data = [
             (u'# Heading 1',
-                '<h outline-level="1">Heading 1</h>'),
+                '<h outline-level="1" xml:id="heading-1">Heading 1</h>'),
             (u'## Heading 2',
-                '<h outline-level="2">Heading 2</h>'),
+                '<h outline-level="2" xml:id="heading-2">Heading 2</h>'),
             (u'### Heading 3',
-                '<h outline-level="3">Heading 3</h>'),
+                '<h outline-level="3" xml:id="heading-3">Heading 3</h>'),
             (u'#### Heading 4',
-                '<h outline-level="4">Heading 4</h>'),
+                '<h outline-level="4" xml:id="heading-4">Heading 4</h>'),
             (u'##### Heading 5',
-                '<h outline-level="5">Heading 5</h>'),
+                '<h outline-level="5" xml:id="heading-5">Heading 5</h>'),
             (u'###### Heading 6',
-                '<h outline-level="6">Heading 6</h>'),
+                '<h outline-level="6" xml:id="heading-6">Heading 6</h>'),
             (u'# Heading 1 #',
-                '<h outline-level="1">Heading 1</h>'),
+                '<h outline-level="1" xml:id="heading-1">Heading 1</h>'),
             (u'## Heading 2 ##',
-                '<h outline-level="2">Heading 2</h>'),
+                '<h outline-level="2" xml:id="heading-2">Heading 2</h>'),
             (u'### Heading 3 ###',
-                '<h outline-level="3">Heading 3</h>'),
+                '<h outline-level="3" xml:id="heading-3">Heading 3</h>'),
             (u'#### Heading 4 ####',
-                '<h outline-level="4">Heading 4</h>'),
+                '<h outline-level="4" xml:id="heading-4">Heading 4</h>'),
             (u'##### Heading 5 #####',
-                '<h outline-level="5">Heading 5</h>'),
+                '<h outline-level="5" xml:id="heading-5">Heading 5</h>'),
             (u'###### Heading 6 ######',
-                '<h outline-level="6">Heading 6</h>'),
+                '<h outline-level="6" xml:id="heading-6">Heading 6</h>'),
             (u'Heading 1\n=========\nHeading 2\n---------\n',
-                '<h outline-level="1">Heading 1</h>\n<h outline-level="2">Heading 2</h>'),
-            (u'Heading 1\n---------\n',
-                '<h outline-level="2">Heading 1</h>'),
+                '<h outline-level="1" xml:id="heading-1">Heading 1</h>\n<h outline-level="2" xml:id="heading-2">Heading 2</h>'),
+            (u'Heading 2\n---------\n',
+                '<h outline-level="2" xml:id="heading-2">Heading 2</h>'),
             (u'Heading\n=======\n\nxxxx',
-                '<h outline-level="1">Heading</h>\n<p>xxxx</p>'),
+                '<h outline-level="1" xml:id="heading">Heading</h>\n<p>xxxx</p>'),
         ]
         for i in data:
             yield (self.do, ) + i