Allow running test_buildhtml.py from anywhere, also with Python 3.
[docutils.git] / test / test_writers / test_pseudoxml.py
blob11d8210d7353dacbfd32866b967484f54508a64e
1 #!/usr/bin/env python
3 # $Id$
4 # Author: Lea Wiemann <LeWiemann@gmail.com>
5 # Copyright: This module has been placed in the public domain.
7 """
8 Test for pseudo-XML writer.
9 """
11 from __init__ import DocutilsTestSupport
13 def suite():
14 s = DocutilsTestSupport.PublishTestSuite('pseudoxml')
15 s.generateTests(totest)
16 return s
18 totest = {}
20 totest['basic'] = [
21 # input
22 ["""\
23 This is a paragraph.
25 ----------
27 This is another paragraph.
29 A Section
30 ---------
32 Foo.
33 """,
34 # output
35 """\
36 <document source="<string>">
37 <paragraph>
38 This is a paragraph.
39 <transition>
40 <paragraph>
41 This is another paragraph.
42 <section ids="a-section" names="a\ section">
43 <title>
44 A Section
45 <paragraph>
46 Foo.
47 """]
50 if __name__ == '__main__':
51 import unittest
52 unittest.main(defaultTest='suite')