diff MoinMoin/converter/_tests/test_rst_in.py @ 2596:611d8ab8063a

fix broken admonitions in ReST, Docbook; add 4 missing admonition types; do not suppress ReST syntax error messages
author RogerHaase <haaserd@gmail.com>
date Mon, 05 May 2014 13:09:11 -0700
parents b980a2ecba15
children
line wrap: on
line diff
--- a/MoinMoin/converter/_tests/test_rst_in.py	Sat May 03 12:45:32 2014 -0700
+++ b/MoinMoin/converter/_tests/test_rst_in.py	Mon May 05 13:09:11 2014 -0700
@@ -48,9 +48,15 @@
             (u'1. a\n   b\n   c\n\n2. b\n\n   d', '''<page><body><list item-label-generate="ordered"><list-item><list-item-body><p>a
 b
 c</p></list-item-body></list-item><list-item><list-item-body><p>b</p><p>d</p></list-item-body></list-item></list></body></page>'''),
-            (u'1. a\n2. b\n\nA. c\n\na. A\n\n   3. B\n\n   4. C\n\n', '<page><body><list item-label-generate="ordered"><list-item><list-item-body><p>a</p></list-item-body></list-item><list-item><list-item-body><p>b</p></list-item-body></list-item></list><list item-label-generate="ordered" list-style-type="upper-alpha"><list-item><list-item-body><p>c</p></list-item-body></list-item></list><list item-label-generate="ordered" list-style-type="lower-alpha"><list-item><list-item-body><p>A</p><list item-label-generate="ordered"><list-item><list-item-body><p>B</p></list-item-body></list-item><list-item><list-item-body><p>C</p></list-item-body></list-item></list></list-item-body></list-item></list></body></page>'),
+            (u'1. a\n2. b\n\nA. c\n\na. A\n\n   1. B\n\n   2. C\n\n', '<page><body><list item-label-generate="ordered"><list-item><list-item-body><p>a</p></list-item-body></list-item><list-item><list-item-body><p>b</p></list-item-body></list-item></list><list item-label-generate="ordered" list-style-type="upper-alpha"><list-item><list-item-body><p>c</p></list-item-body></list-item></list><list item-label-generate="ordered" list-style-type="lower-alpha"><list-item><list-item-body><p>A</p><list item-label-generate="ordered"><list-item><list-item-body><p>B</p></list-item-body></list-item><list-item><list-item-body><p>C</p></list-item-body></list-item></list></list-item-body></list-item></list></body></page>'),
             (u'* A\n\n   - B\n\n      + C\n\n   - D\n\n* E', '<page><body><list item-label-generate="unordered"><list-item><list-item-body><p>A</p><list><list-item><list-item-body><list item-label-generate="unordered"><list-item><list-item-body><p>B</p><list><list-item><list-item-body><list item-label-generate="unordered"><list-item><list-item-body><p>C</p></list-item-body></list-item></list></list-item-body></list-item></list></list-item-body></list-item><list-item><list-item-body><p>D</p></list-item-body></list-item></list></list-item-body></list-item></list></list-item-body></list-item><list-item><list-item-body><p>E</p></list-item-body></list-item></list></body></page>'),
-            (u'what\n      def\n\nhow\n      to', '<page><body><list><list-item><list-item-label>what</list-item-label><list-item-body><p>def</p></list-item-body></list-item><list-item><list-item-label>how</list-item-label><list-item-body><p>to</p></list-item-body></list-item></list></body></page>')
+            (u'what\n      def\n\nhow\n      to', '<page><body><list><list-item><list-item-label>what</list-item-label><list-item-body><p>def</p></list-item-body></list-item><list-item><list-item-label>how</list-item-label><list-item-body><p>to</p></list-item-body></list-item></list></body></page>'),
+            # starting an ordered list with a value other than 1 generates an error
+            (u' 3. A\n #. B',
+                '<page><body><list><list-item><list-item-body><list item-label-generate="ordered"><list-item><list-item-body><p>A</p>'
+                '</list-item-body></list-item><list-item><list-item-body><p>B</p></list-item-body></list-item></list>'
+                '<admonition type="error"><p>Enumerated list start value not ordinal-1: "3" (ordinal 3)</p></admonition>'
+                '</list-item-body></list-item></list></body></page>'),
         ]
         for i in data:
             yield (self.do, ) + i