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

« back to all changes in this revision

Viewing changes to test/test_parsers/test_rst/test_directives/test_sidebars.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: 3206 $
 
6
# Date: $Date: 2005-04-12 01:16:11 +0200 (Tue, 12 Apr 2005) $
 
7
# Copyright: This module has been placed in the public domain.
 
8
 
 
9
"""
 
10
Tests for the "sidebar" directive.
 
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['sidebars'] = [
 
23
["""\
 
24
.. sidebar:: Outer
 
25
 
 
26
   .. sidebar:: Nested
 
27
 
 
28
      Body.
 
29
""",
 
30
"""\
 
31
<document source="test data">
 
32
    <sidebar>
 
33
        <title>
 
34
            Outer
 
35
        <system_message level="3" line="3" source="test data" type="ERROR">
 
36
            <paragraph>
 
37
                The "sidebar" directive may not be used within a sidebar element.
 
38
            <literal_block xml:space="preserve">
 
39
                .. sidebar:: Nested
 
40
                \n\
 
41
                   Body.
 
42
"""],
 
43
["""\
 
44
.. sidebar:: Outer
 
45
 
 
46
   .. topic:: Topic
 
47
 
 
48
      .. sidebar:: Inner
 
49
 
 
50
         text
 
51
""",
 
52
"""\
 
53
<document source="test data">
 
54
    <sidebar>
 
55
        <title>
 
56
            Outer
 
57
        <topic>
 
58
            <title>
 
59
                Topic
 
60
            <system_message level="3" line="5" source="test data" type="ERROR">
 
61
                <paragraph>
 
62
                    The "sidebar" directive may not be used within topics or body elements.
 
63
                <literal_block xml:space="preserve">
 
64
                    .. sidebar:: Inner
 
65
                    \n\
 
66
                       text
 
67
"""],
 
68
]
 
69
 
 
70
 
 
71
if __name__ == '__main__':
 
72
    import unittest
 
73
    unittest.main(defaultTest='suite')