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

« back to all changes in this revision

Viewing changes to test/test_transforms/test_expose_internals.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: Felix Wiemann
 
4
# Contact: Felix_Wiemann@ososo.de
 
5
# Revision: $Revision: 4132 $
 
6
# Date: $Date: 2005-12-03 03:13:12 +0100 (Sat, 03 Dec 2005) $
 
7
# Copyright: This module has been placed in the public domain.
 
8
 
 
9
"""
 
10
Test module for universal.ExposeInternals transform.
 
11
"""
 
12
 
 
13
 
 
14
from __init__ import DocutilsTestSupport # must be imported before docutils
 
15
from docutils.transforms.universal import ExposeInternals
 
16
from docutils.parsers.rst import Parser
 
17
 
 
18
def suite():
 
19
    parser = Parser()
 
20
    s = DocutilsTestSupport.TransformTestSuite(
 
21
        parser, suite_settings={'expose_internals': ['rawsource', 'source']})
 
22
    s.generateTests(totest)
 
23
    return s
 
24
 
 
25
 
 
26
totest = {}
 
27
 
 
28
totest['transitions'] = ((ExposeInternals,), [
 
29
["""\
 
30
This is a test.
 
31
""",
 
32
"""\
 
33
<document internal:rawsource="" source="test data">
 
34
    <paragraph internal:rawsource="This is a test." internal:source="test data">
 
35
        This is a test.
 
36
"""],
 
37
])
 
38
 
 
39
 
 
40
if __name__ == '__main__':
 
41
    import unittest
 
42
    unittest.main(defaultTest='suite')