~ubuntu-branches/ubuntu/hardy/python-docutils/hardy

« back to all changes in this revision

Viewing changes to test/test_parsers/test_rst/test_directives/test_container.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
# Author: David Goodger
 
4
# Contact: goodger@python.org
 
5
# Revision: $Revision: 4162 $
 
6
# Date: $Date: 2005-12-08 18:28:40 +0100 (Thu, 08 Dec 2005) $
 
7
# Copyright: This module has been placed in the public domain.
 
8
 
 
9
"""
 
10
Tests for the 'container' directive from body.py.
 
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['container'] = [
 
23
["""\
 
24
.. container::
 
25
 
 
26
   "container" is a generic element, an extension mechanism for
 
27
   users & applications.
 
28
 
 
29
   Containers may contain arbitrary body elements.
 
30
""",
 
31
"""\
 
32
<document source="test data">
 
33
    <container>
 
34
        <paragraph>
 
35
            "container" is a generic element, an extension mechanism for
 
36
            users & applications.
 
37
        <paragraph>
 
38
            Containers may contain arbitrary body elements.
 
39
"""],
 
40
["""\
 
41
.. container:: custom
 
42
 
 
43
   Some text.
 
44
""",
 
45
"""\
 
46
<document source="test data">
 
47
    <container classes="custom">
 
48
        <paragraph>
 
49
            Some text.
 
50
"""],
 
51
["""\
 
52
.. container:: one two three
 
53
   four
 
54
 
 
55
   Multiple classes.
 
56
 
 
57
   Multi-line argument.
 
58
 
 
59
   Multiple paragraphs in the container.
 
60
""",
 
61
"""\
 
62
<document source="test data">
 
63
    <container classes="one two three four">
 
64
        <paragraph>
 
65
            Multiple classes.
 
66
        <paragraph>
 
67
            Multi-line argument.
 
68
        <paragraph>
 
69
            Multiple paragraphs in the container.
 
70
"""],
 
71
]
 
72
 
 
73
 
 
74
if __name__ == '__main__':
 
75
    import unittest
 
76
    unittest.main(defaultTest='suite')