comparison 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
comparison
equal deleted inserted replaced
2595:43f68139d90e 2596:611d8ab8063a
46 def test_list(self): 46 def test_list(self):
47 data = [ 47 data = [
48 (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 48 (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
49 b 49 b
50 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>'''), 50 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>'''),
51 (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>'), 51 (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>'),
52 (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>'), 52 (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>'),
53 (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>') 53 (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>'),
54 # starting an ordered list with a value other than 1 generates an error
55 (u' 3. A\n #. B',
56 '<page><body><list><list-item><list-item-body><list item-label-generate="ordered"><list-item><list-item-body><p>A</p>'
57 '</list-item-body></list-item><list-item><list-item-body><p>B</p></list-item-body></list-item></list>'
58 '<admonition type="error"><p>Enumerated list start value not ordinal-1: "3" (ordinal 3)</p></admonition>'
59 '</list-item-body></list-item></list></body></page>'),
54 ] 60 ]
55 for i in data: 61 for i in data:
56 yield (self.do, ) + i 62 yield (self.do, ) + i
57 63
58 def test_image(self): 64 def test_image(self):