root / logilab.pylintinstaller / logilab / common / test / unittest_ureports_text.py

Revision 202:d67e86292521, 1.6 kB (checked in by tziade@…, 11 months ago)

added logilab.pylintinstaller

Line 
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
6from utils import WriterTC
7from logilab.common.testlib import TestCase, unittest_main
8from logilab.common.ureports.text_writer import TextWriter
9
10class TextWriterTC(TestCase, WriterTC):
11    def setUp(self):
12        self.writer = TextWriter()
13
14    # Section tests ###########################################################
15    section_base = '''
16Section title
17=============
18Section\'s description.
19Blabla bla
20
21'''
22    section_nested = '''
23Section title
24=============
25Section\'s description.
26Blabla bla
27
28Subsection
29----------
30Sub section description
31
32
33'''
34   
35    # List tests ##############################################################
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    # Table tests #############################################################
51    table_base = '''
52+------+------+
53|head1 |head2 |
54+------+------+
55|cell1 |cell2 |
56+------+------+
57
58'''
59    field_table = '''
60f1  : v1
61f22 : v22
62f333: 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    # VerbatimText tests ######################################################
81    verbatim_base = '''::
82
83    blablabla
84
85'''
86   
87if __name__ == '__main__':
88    unittest_main()
Note: See TracBrowser for help on using the browser.