build.test.test_parsers.test_rst.test_outdenting.py Maven / Gradle / Ivy
#! /usr/bin/env python
# $Id: test_outdenting.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger
# Copyright: This module has been placed in the public domain.
"""
Tests for states.py.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupport.ParserTestSuite()
s.generateTests(totest)
return s
totest = {}
totest['outdenting'] = [
["""\
Anywhere a paragraph would have an effect on the current
indentation level, a comment or list item should also.
+ bullet
This paragraph ends the bullet list item before a block quote.
Block quote.
""",
"""\
Anywhere a paragraph would have an effect on the current
indentation level, a comment or list item should also.
bullet
This paragraph ends the bullet list item before a block quote.
Block quote.
"""],
["""\
+ bullet
.. Comments swallow up all indented text following.
(Therefore this is not a) block quote.
- bullet
If we want a block quote after this bullet list item,
we need to use an empty comment:
..
Block quote.
""",
"""\
bullet
Comments swallow up all indented text following.
\n\
(Therefore this is not a) block quote.
bullet
If we want a block quote after this bullet list item,
we need to use an empty comment:
Block quote.
"""],
]
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')