~ubuntu-branches/ubuntu/hardy/python-docutils/hardy

« back to all changes in this revision

Viewing changes to test/test_transforms/test_strip_comments.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@python.org
 
5
# Revision: $Revision: 4183 $
 
6
# Date: $Date: 2005-12-12 05:12:02 +0100 (Mon, 12 Dec 2005) $
 
7
# Copyright: This module has been placed in the public domain.
 
8
 
 
9
"""
 
10
Tests for docutils.transforms.universal.StripComments.
 
11
"""
 
12
 
 
13
from __init__ import DocutilsTestSupport
 
14
from docutils.transforms.universal import StripComments
 
15
from docutils.parsers.rst import Parser
 
16
 
 
17
 
 
18
def suite():
 
19
    parser = Parser()
 
20
    s = DocutilsTestSupport.TransformTestSuite(
 
21
        parser, suite_settings={'strip_comments': 1})
 
22
    s.generateTests(totest)
 
23
    return s
 
24
 
 
25
totest = {}
 
26
 
 
27
totest['strip_comments'] = ((StripComments,), [
 
28
["""\
 
29
.. this is a comment
 
30
 
 
31
Title
 
32
=====
 
33
 
 
34
Paragraph.
 
35
""",
 
36
"""\
 
37
<document source="test data">
 
38
    <section ids="title" names="title">
 
39
        <title>
 
40
            Title
 
41
        <paragraph>
 
42
            Paragraph.
 
43
"""],
 
44
])
 
45
 
 
46
 
 
47
if __name__ == '__main__':
 
48
    import unittest
 
49
    unittest.main(defaultTest='suite')