Allow also non-ASCII whitespace characters around inline markup.
[docutils.git] / test / test_transforms / test_peps.py
blob91a18269c6150829ba08ba77c1224b5fbb52f6b5
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 docutils.transforms.peps.
9 """
11 from __init__ import DocutilsTestSupport
12 from docutils.transforms.peps import TargetNotes
13 from docutils.parsers.rst import Parser
16 def suite():
17 parser = Parser()
18 s = DocutilsTestSupport.TransformTestSuite(parser)
19 s.generateTests(totest)
20 return s
22 totest = {}
24 totest['target_notes'] = ((TargetNotes,), [
25 ["""\
26 No references or targets exist, therefore
27 no "References" section should be generated.
28 """,
29 """\
30 <document source="test data">
31 <paragraph>
32 No references or targets exist, therefore
33 no "References" section should be generated.
34 """],
35 ["""\
36 A target exists, here's the reference_.
37 A "References" section should be generated.
39 .. _reference: http://www.example.org
40 """,
41 """\
42 <document source="test data">
43 <paragraph>
44 A target exists, here's the \n\
45 <reference name="reference" refname="reference">
46 reference
47 \n\
48 <footnote_reference auto="1" ids="id3" refname="TARGET_NOTE: id2">
50 A "References" section should be generated.
51 <target ids="reference" names="reference" refuri="http://www.example.org">
52 <section ids="id1">
53 <title>
54 References
55 <footnote auto="1" ids="id2" names="TARGET_NOTE:\ id2">
56 <paragraph>
57 <reference refuri="http://www.example.org">
58 http://www.example.org
59 """],
64 if __name__ == '__main__':
65 import unittest
66 unittest.main(defaultTest='suite')