~ubuntu-branches/ubuntu/karmic/python-docutils/karmic

« back to all changes in this revision

Viewing changes to test/test_rst/test_directives/test_test_directives.py

  • Committer: Bazaar Package Importer
  • Author(s): martin f. krafft
  • Date: 2006-07-10 11:45:05 UTC
  • mfrom: (2.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20060710114505-otkhqcslevewxmz5
Tags: 0.4-3
Added build dependency on python-central (closes: #377580).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/env python
2
 
 
3
 
"""
4
 
:Author: David Goodger
5
 
:Contact: goodger@users.sourceforge.net
6
 
:Revision: $Revision: 1.3 $
7
 
:Date: $Date: 2002/04/25 03:41:52 $
8
 
:Copyright: This module has been placed in the public domain.
9
 
 
10
 
Tests for misc.py test directives.
11
 
"""
12
 
 
13
 
from __init__ import DocutilsTestSupport
14
 
 
15
 
def suite():
16
 
    s = DocutilsTestSupport.ParserTestSuite()
17
 
    s.generateTests(totest)
18
 
    return s
19
 
 
20
 
totest = {}
21
 
 
22
 
totest['test_directives'] = [
23
 
["""\
24
 
.. reStructuredText-test-directive::
25
 
 
26
 
Paragraph.
27
 
""",
28
 
"""\
29
 
<document>
30
 
    <system_message level="1" type="INFO">
31
 
        <paragraph>
32
 
            Directive processed. Type="reStructuredText-test-directive", data="", directive block: None
33
 
    <paragraph>
34
 
        Paragraph.
35
 
"""],
36
 
["""\
37
 
.. reStructuredText-test-directive:: argument
38
 
 
39
 
Paragraph.
40
 
""",
41
 
"""\
42
 
<document>
43
 
    <system_message level="1" type="INFO">
44
 
        <paragraph>
45
 
            Directive processed. Type="reStructuredText-test-directive", data="argument", directive block: None
46
 
    <paragraph>
47
 
        Paragraph.
48
 
"""],
49
 
["""\
50
 
.. reStructuredText-test-directive::
51
 
 
52
 
   Directive block contains one paragraph, with a blank line before.
53
 
 
54
 
Paragraph.
55
 
""",
56
 
"""\
57
 
<document>
58
 
    <system_message level="1" type="INFO">
59
 
        <paragraph>
60
 
            Directive processed. Type="reStructuredText-test-directive", data="", directive block:
61
 
        <literal_block>
62
 
            Directive block contains one paragraph, with a blank line before.
63
 
    <paragraph>
64
 
        Paragraph.
65
 
"""],
66
 
["""\
67
 
.. reStructuredText-test-directive::
68
 
   Directive block contains one paragraph, no blank line before.
69
 
 
70
 
Paragraph.
71
 
""",
72
 
"""\
73
 
<document>
74
 
    <system_message level="1" type="INFO">
75
 
        <paragraph>
76
 
            Directive processed. Type="reStructuredText-test-directive", data="", directive block:
77
 
        <literal_block>
78
 
            Directive block contains one paragraph, no blank line before.
79
 
    <paragraph>
80
 
        Paragraph.
81
 
"""],
82
 
["""\
83
 
.. reStructuredText-test-directive::
84
 
   block
85
 
no blank line.
86
 
 
87
 
Paragraph.
88
 
""",
89
 
"""\
90
 
<document>
91
 
    <system_message level="1" type="INFO">
92
 
        <paragraph>
93
 
            Directive processed. Type="reStructuredText-test-directive", data="", directive block:
94
 
        <literal_block>
95
 
            block
96
 
    <system_message level="2" type="WARNING">
97
 
        <paragraph>
98
 
            Explicit markup ends without a blank line; unexpected unindent at line 3.
99
 
    <paragraph>
100
 
        no blank line.
101
 
    <paragraph>
102
 
        Paragraph.
103
 
"""],
104
 
]
105
 
 
106
 
 
107
 
if __name__ == '__main__':
108
 
    import unittest
109
 
    unittest.main(defaultTest='suite')