1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 import sys
25
26
28 """Function for printing the subtitles.
29
30 @param text: The text of the subtitle to be printed.
31 @type text: str
32 """
33
34
35 width = len(text) + 2
36
37
38 sys.stdout.write("# %s\n" % text)
39
40
41 sys.stdout.write("#" * width)
42
43
44 sys.stdout.write("\n\n")
45
46
48 """Print a summary line.
49
50 @param name: The name of the test, test category, etc.
51 @type name: str
52 @param passed: An argument which if True causes '[ OK ]' to be printed and if False causes '[ Failed ]' to be printed. The special string 'skip' is used to indicate that this has been skipped.
53 @type passed: bool or str
54 @keyword width: The width of the line, excluding the terminal '[ OK ]' or '[ Failed ]'.
55 @type width: int
56 """
57
58
59 sys.stdout.write(name + " ")
60
61
62 for j in xrange(width - len(name)):
63 sys.stdout.write(".")
64
65
66 if passed == True:
67 sys.stdout.write(" %-10s\n" % "[ OK ]")
68
69
70 elif passed == 'skip':
71 sys.stdout.write(" %-10s\n" % "[ Skipped ]")
72
73
74 else:
75 sys.stdout.write(" %-10s\n" % "[ Failed ]")
76
77
79 """Function for printing the titles.
80
81 @param text: The text of the title to be printed.
82 @type text: str
83 """
84
85
86 width = len(text) + 4
87
88
89 sys.stdout.write("\n\n\n\n")
90
91
92 sys.stdout.write("#" * width)
93 sys.stdout.write("\n")
94
95
96 sys.stdout.write("# %s #\n" % text)
97
98
99 sys.stdout.write("#" * width)
100
101
102 sys.stdout.write("\n\n\n")
103