1 '''unit tests for ureports.text_writer
2 '''
3
4 __revision__ = "$Id: unittest_ureports_text.py,v 1.4 2005-05-27 12:27:08 syt Exp $"
5
6 from utils import WriterTC
7 from logilab.common.testlib import TestCase, unittest_main
8 from logilab.common.ureports.text_writer import TextWriter
9
10 -class TextWriterTC(TestCase, WriterTC):
12 self.writer = TextWriter()
13
14
15 section_base = '''
16 Section title
17 =============
18 Section\'s description.
19 Blabla bla
20
21 '''
22 section_nested = '''
23 Section title
24 =============
25 Section\'s description.
26 Blabla bla
27
28 Subsection
29 ----------
30 Sub section description
31
32
33 '''
34
35
36 list_base = '''
37 * item1
38 * item2
39 * item3
40 * item4'''
41
42 nested_list = '''
43 * blabla
44 - 1
45 - 2
46 - 3
47
48 * an other point'''
49
50
51 table_base = '''
52 +------+------+
53 |head1 |head2 |
54 +------+------+
55 |cell1 |cell2 |
56 +------+------+
57
58 '''
59 field_table = '''
60 f1 : v1
61 f22 : v22
62 f333: v333
63 '''
64 advanced_table = '''
65 +---------------+------+
66 |field |value |
67 +===============+======+
68 |f1 |v1 |
69 +---------------+------+
70 |f22 |v22 |
71 +---------------+------+
72 |f333 |v333 |
73 +---------------+------+
74 |`toi perdu ?`_ | |
75 +---------------+------+
76
77 '''
78
79
80
81 verbatim_base = '''::
82
83 blablabla
84
85 '''
86
87 if __name__ == '__main__':
88 unittest_main()
89