4 # Author: David Goodger <goodger@python.org>
5 # Copyright: This module has been placed in the public domain.
11 from __init__
import DocutilsTestSupport
14 s
= DocutilsTestSupport
.SimpleTableParserTestSuite()
15 s
.generateTests(totest
)
20 totest
['simple_tables'] = [
22 ============ ============
23 A table with two columns.
24 ============ ============
28 [[[0, 0, 1, ['A table with']],
29 [0, 0, 1, ['two columns.']]]])],
31 ============ ============
32 A table with two columns
34 ============ ============
38 [[[0, 0, 1, ['A table with']],
39 [0, 0, 1, ['two columns']]],
41 [0, 0, 2, ['two rows.']]]])],
43 ======================================
44 The last row might stick into the margin
46 ======================================
50 [[[0, 0, 1, ['The last row might stick into the margin']]],
51 [[0, 0, 2, ['second row.']]]])],
53 ========== ===========
54 A table with four rows,
55 -----------------------
59 =======================
63 [[[0, 1, 1, ['A table with four rows,']]],
64 [[0, 0, 3, ['and two']],
65 [0, 0, 3, ['columns.']]],
66 [[0, 0, 4, ['First and']],
67 [0, 0, 4, ['last rows']]],
68 [[0, 1, 5, ['contain column spans.']]]])],
75 'TableMarkupError: Text in column margin at line offset 1.'],
82 'TableMarkupError: Text in column margin at line offset 2.'],
84 =========== ================
85 A table with two header rows,
86 -----------------------------
87 the first with a span.
88 =========== ================
90 the second with a span.
91 =============================
94 [[[0, 1, 1, ['A table with two header rows,']]],
95 [[0, 0, 3, ['the first']],
96 [0, 0, 3, ['with a span.']]]],
97 [[[0, 0, 5, ['Two body']],
98 [0, 0, 5, ['rows,']]],
99 [[0, 1, 6, ['the second with a span.']]]])],
101 ============ =============
102 A table with two head/body
103 ============ =============
105 ============ =============
107 ============ =============
109 'TableMarkupError: Multiple head/body row separators in table '
110 '(at line offset 2 and 4); only one allowed.'],
112 ============ ============
113 ============ ============
120 # ============== ==========
121 # Table with row separators
122 # ============== ==========
124 # -------------- ----------
126 # -------------- ----------
128 # -------------- ----------
130 # ============== ==========
136 if __name__
== '__main__':
138 unittest
.main(defaultTest
='suite')