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

« back to all changes in this revision

Viewing changes to test/test_transforms/test_final_checks.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@users.sourceforge.net
5
 
# Revision: $Revision: 1.5 $
6
 
# Date: $Date: 2002/10/08 01:34:51 $
7
 
# Copyright: This module has been placed in the public domain.
8
 
 
9
 
"""
10
 
Tests for docutils.transforms.universal.FinalChecks.
11
 
"""
12
 
 
13
 
from __init__ import DocutilsTestSupport
14
 
from docutils.transforms.universal import FinalChecks
15
 
from docutils.parsers.rst import Parser
16
 
 
17
 
 
18
 
def suite():
19
 
    parser = Parser()
20
 
    s = DocutilsTestSupport.TransformTestSuite(parser)
21
 
    s.generateTests(totest)
22
 
    return s
23
 
 
24
 
totest = {}
25
 
 
26
 
totest['final_checks'] = ((FinalChecks,), [
27
 
["""\
28
 
Unknown reference_.
29
 
""",
30
 
"""\
31
 
<document source="test data">
32
 
    <paragraph>
33
 
        Unknown \n\
34
 
        <problematic id="id2" refid="id1">
35
 
            reference_
36
 
        .
37
 
    <system_message backrefs="id2" id="id1" level="3" line="1" source="test data" type="ERROR">
38
 
        <paragraph>
39
 
            Unknown target name: "reference".
40
 
"""],
41
 
])
42
 
 
43
 
 
44
 
if __name__ == '__main__':
45
 
    import unittest
46
 
    unittest.main(defaultTest='suite')