Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
#! /usr/bin/env python
# $Id: test_literal_blocks.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['indented_literal_blocks'] = [
["""\
A paragraph::
A literal block.
""",
"""\
A paragraph:
A literal block.
"""],
["""\
A paragraph with a space after the colons:: \n\
A literal block.
""",
"""\
A paragraph with a space after the colons:
A literal block.
"""],
["""\
A paragraph::
A literal block.
Another paragraph::
Another literal block.
With two blank lines following.
A final paragraph.
""",
"""\
A paragraph:
A literal block.
Another paragraph:
Another literal block.
With two blank lines following.
A final paragraph.
"""],
["""\
A paragraph
on more than
one line::
A literal block.
""",
"""\
A paragraph
on more than
one line:
A literal block.
"""],
["""\
A paragraph
on more than
one line::
A literal block
with no blank line above.
""",
"""\
A paragraph
on more than
one line:
Unexpected indentation.
A literal block
with no blank line above.
"""],
["""\
A paragraph::
A literal block.
no blank line
""",
"""\
A paragraph:
A literal block.
Literal block ends without a blank line; unexpected unindent.
no blank line
"""],
[r"""
A paragraph\\::
A literal block.
A paragraph\::
Not a literal block.
""",
r"""
A paragraph\:
A literal block.
A paragraph::
Not a literal block.
"""],
[r"""
\\::
A literal block.
\::
Not a literal block.
""",
r"""
\:
A literal block.
::
Not a literal block.
"""],
["""\
A paragraph: ::
A literal block.
""",
"""\
A paragraph:
A literal block.
"""],
["""\
A paragraph:
::
A literal block.
""",
"""\
A paragraph:
A literal block.
"""],
["""\
A paragraph:
::
A literal block.
""",
"""\
Possible title underline, too short for the title.
Treating it as ordinary text because it's so short.
A paragraph:
A literal block.
"""],
["""\
A paragraph:
::
A literal block.
""",
"""\
A paragraph:
A literal block.
"""],
["""\
A paragraph::
Not a literal block.
""",
"""\
A paragraph:
Literal block expected; none found.
Not a literal block.
"""],
["""\
A paragraph::
A wonky literal block.
Literal line 2.
Literal line 3.
""",
"""\
A paragraph:
A wonky literal block.
Literal line 2.
\n\
Literal line 3.
"""],
["""\
EOF, even though a literal block is indicated::
""",
"""\
EOF, even though a literal block is indicated:
Literal block expected; none found.
"""],
]
totest['quoted_literal_blocks'] = [
["""\
A paragraph::
> A literal block.
""",
"""\
A paragraph:
> A literal block.
"""],
["""\
A paragraph::
> A literal block.
""",
"""\
A paragraph:
> A literal block.
"""],
["""\
A paragraph::
> A literal block.
> Line 2.
""",
"""\
A paragraph:
> A literal block.
> Line 2.
"""],
["""\
A paragraph::
> A literal block.
Indented line.
""",
"""\
A paragraph:
> A literal block.
Unexpected indentation.
Indented line.
"""],
["""\
A paragraph::
> A literal block.
Text.
""",
"""\
A paragraph:
> A literal block.
Inconsistent literal block quoting.
Text.
"""],
["""\
A paragraph::
> A literal block.
$ Inconsistent line.
""",
"""\
A paragraph:
> A literal block.
Inconsistent literal block quoting.
$ Inconsistent line.
"""],
]
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')