summaryrefslogtreecommitdiff
path: root/test/test_writers/test_pseudoxml.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_writers/test_pseudoxml.py')
-rwxr-xr-xtest/test_writers/test_pseudoxml.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/test/test_writers/test_pseudoxml.py b/test/test_writers/test_pseudoxml.py
new file mode 100755
index 000000000..db8bed7cb
--- /dev/null
+++ b/test/test_writers/test_pseudoxml.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+
+# Author: Felix Wiemann
+# Contact: Felix_Wiemann@ososo.de
+# Revision: $Revision$
+# Date: $Date$
+# Copyright: This module has been placed in the public domain.
+
+"""
+Test for pseudo-XML writer.
+"""
+
+from __init__ import DocutilsTestSupport
+
+def suite():
+ s = DocutilsTestSupport.PublishTestSuite('pseudoxml')
+ s.generateTests(totest)
+ return s
+
+totest = {}
+
+totest['basic'] = [
+# input
+["""\
+This is a paragraph.
+
+----------
+
+This is another paragraph.
+
+A Section
+---------
+
+Foo.
+""",
+# output
+"""\
+<document source="<string>">
+ <paragraph>
+ This is a paragraph.
+ <transition>
+ <paragraph>
+ This is another paragraph.
+ <section ids="a-section" names="a\ section">
+ <title>
+ A Section
+ <paragraph>
+ Foo.
+"""]
+]
+
+if __name__ == '__main__':
+ import unittest
+ unittest.main(defaultTest='suite')