~ubuntu-branches/ubuntu/jaunty/python-docutils/jaunty

« back to all changes in this revision

Viewing changes to test/test_parsers/test_rst/test_directives/test_sectnum.py

  • Committer: Bazaar Package Importer
  • Author(s): Simon McVittie
  • Date: 2008-07-24 10:39:53 UTC
  • mfrom: (1.1.4 upstream) (3.1.7 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080724103953-8gh4uezg17g9ysgy
Tags: 0.5-2
* Upload docutils 0.5 to unstable
* Update rst.el to upstream Subversion r5596, which apparently fixes
  all its performance problems (17_speed_up_rst_el.dpatch, closes: #474941)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
 
 
3
# $Id: test_sectnum.py 5174 2007-05-31 00:01:52Z wiemann $
 
4
# Author: Lea Wiemann <LeWiemann@gmail.com>
 
5
# Copyright: This module has been placed in the public domain.
 
6
 
 
7
"""
 
8
Tests for the 'sectnum' directive.
 
9
"""
 
10
 
 
11
from __init__ import DocutilsTestSupport
 
12
 
 
13
def suite():
 
14
    s = DocutilsTestSupport.ParserTestSuite()
 
15
    s.generateTests(totest)
 
16
    return s
 
17
 
 
18
totest = {}
 
19
 
 
20
totest['sectnum'] = [
 
21
["""\
 
22
.. sectnum::
 
23
""",
 
24
"""\
 
25
<document source="test data">
 
26
    <pending>
 
27
        .. internal attributes:
 
28
             .transform: docutils.transforms.parts.SectNum
 
29
             .details:
 
30
"""],
 
31
["""\
 
32
.. sectnum::
 
33
   :depth: 23
 
34
   :start: 42
 
35
   :prefix: A Prefix
 
36
   :suffix: A Suffix
 
37
""",
 
38
"""\
 
39
<document source="test data">
 
40
    <pending>
 
41
        .. internal attributes:
 
42
             .transform: docutils.transforms.parts.SectNum
 
43
             .details:
 
44
               depth: 23
 
45
               prefix: 'A Prefix'
 
46
               start: 42
 
47
               suffix: 'A Suffix'
 
48
"""],
 
49
]
 
50
 
 
51
 
 
52
if __name__ == '__main__':
 
53
    import unittest
 
54
    unittest.main(defaultTest='suite')