~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_target_notes.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@users.sourceforge.net
 
5
# Revision: $Revision: 4156 $
 
6
# Date: $Date: 2005-12-08 05:43:13 +0100 (Thu, 08 Dec 2005) $
 
7
# Copyright: This module has been placed in the public domain.
 
8
 
 
9
"""
 
10
Tests for the target-notes 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['target-notes'] = [
 
23
["""\
 
24
.. target-notes::
 
25
""",
 
26
"""\
 
27
<document source="test data">
 
28
    <pending>
 
29
        .. internal attributes:
 
30
             .transform: docutils.transforms.references.TargetNotes
 
31
             .details:
 
32
"""],
 
33
["""\
 
34
.. target-notes:: :class: custom
 
35
""",
 
36
"""\
 
37
<document source="test data">
 
38
    <pending>
 
39
        .. internal attributes:
 
40
             .transform: docutils.transforms.references.TargetNotes
 
41
             .details:
 
42
               class: ['custom']
 
43
"""],
 
44
["""\
 
45
.. target-notes::
 
46
   :class:
 
47
""",
 
48
"""\
 
49
<document source="test data">
 
50
    <system_message level="3" line="1" source="test data" type="ERROR">
 
51
        <paragraph>
 
52
            Error in "target-notes" directive:
 
53
            invalid option value: (option: "class"; value: None)
 
54
            argument required but none supplied.
 
55
        <literal_block xml:space="preserve">
 
56
            .. target-notes::
 
57
               :class:
 
58
"""],
 
59
]
 
60
 
 
61
 
 
62
if __name__ == '__main__':
 
63
    import unittest
 
64
    unittest.main(defaultTest='suite')