Website: add template and basic stylesheet with menu. Update buildhtml.py (and theref...
[docutils.git] / sandbox / gitpull / web_stylesheet_and_menu / test / test_parsers / test_rst / test_directives / test_container.py
bloba97a020612653475d2bf11c3676e9a1785968f5f
1 #! /usr/bin/env python
3 # $Id$
4 # Author: David Goodger <goodger@python.org>
5 # Copyright: This module has been placed in the public domain.
7 """
8 Tests for the 'container' directive from body.py.
9 """
11 from __init__ import DocutilsTestSupport
13 def suite():
14 s = DocutilsTestSupport.ParserTestSuite()
15 s.generateTests(totest)
16 return s
18 totest = {}
20 totest['container'] = [
21 ["""\
22 .. container::
24 "container" is a generic element, an extension mechanism for
25 users & applications.
27 Containers may contain arbitrary body elements.
28 """,
29 """\
30 <document source="test data">
31 <container>
32 <paragraph>
33 "container" is a generic element, an extension mechanism for
34 users & applications.
35 <paragraph>
36 Containers may contain arbitrary body elements.
37 """],
38 ["""\
39 .. container:: custom
41 Some text.
42 """,
43 """\
44 <document source="test data">
45 <container classes="custom">
46 <paragraph>
47 Some text.
48 """],
49 ["""\
50 .. container:: one two three
51 four
53 Multiple classes.
55 Multi-line argument.
57 Multiple paragraphs in the container.
58 """,
59 """\
60 <document source="test data">
61 <container classes="one two three four">
62 <paragraph>
63 Multiple classes.
64 <paragraph>
65 Multi-line argument.
66 <paragraph>
67 Multiple paragraphs in the container.
68 """],
69 ["""\
70 .. container::
71 :name: my name
73 The name argument allows hyperlinks to `my name`_.
74 """,
75 """\
76 <document source="test data">
77 <container ids="my-name" names="my\ name">
78 <paragraph>
79 The name argument allows hyperlinks to
80 <reference name="my name" refname="my name">
81 my name
83 """],
87 if __name__ == '__main__':
88 import unittest
89 unittest.main(defaultTest='suite')