1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/usr/bin/python
"""
:Author: David Goodger
:Contact: goodger@users.sourceforge.net
:Revision: $Revision: 1.2 $
:Date: $Date: 2002/04/25 03:41:58 $
:Copyright: This module has been placed in the public domain.
Tests for unknown directives.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupport.ParserTestSuite()
s.generateTests(totest)
return s
totest = {}
totest['unknown'] = [
["""\
.. reStructuredText-unknown-directive::
.. reStructuredText-unknown-directive:: argument
.. reStructuredText-unknown-directive::
block
""",
"""\
<document>
<system_message level="3" type="ERROR">
<paragraph>
Unknown directive type "reStructuredText-unknown-directive" at line 1.
<literal_block>
.. reStructuredText-unknown-directive::
<system_message level="3" type="ERROR">
<paragraph>
Unknown directive type "reStructuredText-unknown-directive" at line 3.
<literal_block>
.. reStructuredText-unknown-directive:: argument
<system_message level="3" type="ERROR">
<paragraph>
Unknown directive type "reStructuredText-unknown-directive" at line 5.
<literal_block>
.. reStructuredText-unknown-directive::
block
"""],
]
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')
|