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 A table with four rows,
45 -----------------------
49 =======================
53 [[[0, 1, 1, ['A table with four rows,']]],
54 [[0, 0, 3, ['and two']],
55 [0, 0, 3, ['columns.']]],
56 [[0, 0, 4, ['First and']],
57 [0, 0, 4, ['last rows']]],
58 [[0, 1, 5, ['contain column spans.']]]])],
65 'TableMarkupError: Text in column margin at line offset 1.'],
67 =========== ================
68 A table with two header rows,
69 -----------------------------
70 the first with a span.
71 =========== ================
73 the second with a span.
74 =============================
77 [[[0, 1, 1, ['A table with two header rows,']]],
78 [[0, 0, 3, ['the first']],
79 [0, 0, 3, ['with a span.']]]],
80 [[[0, 0, 5, ['Two body']],
81 [0, 0, 5, ['rows,']]],
82 [[0, 1, 6, ['the second with a span.']]]])],
84 ============ =============
85 A table with two head/body
86 ============ =============
88 ============ =============
90 ============ =============
92 'TableMarkupError: Multiple head/body row separators in table '
93 '(at line offset 2 and 4); only one allowed.'],
95 ============ ============
96 ============ ============
103 # ============== ==========
104 # Table with row separators
105 # ============== ==========
107 # -------------- ----------
109 # -------------- ----------
111 # -------------- ----------
113 # ============== ==========
119 if __name__
== '__main__':
121 unittest
.main(defaultTest
='suite')