Merge "Change PTL informatin in INFO"
[bottlenecks.git] / testsuites / vstf / vstf_scripts / vstf / controller / settings / html_settings.py
1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 import logging
11
12 import vstf.controller.settings.settings as sets
13
14 LOG = logging.getLogger(__name__)
15
16
17 class HtmlSettings(sets.Settings):
18
19     def __init__(
20             self,
21             path="/etc/vstf/",
22             filename="reporters.html-settings",
23             mode=sets.SETS_DEFAULT):
24         super(HtmlSettings, self).__init__(path, filename, mode)
25
26
27 def unit_test():
28     from vstf.common.log import setup_logging
29     setup_logging(
30         level=logging.DEBUG,
31         log_file="/var/log/html-settings.log",
32         clevel=logging.DEBUG)
33     html_settings = HtmlSettings()
34     style = {
35         'table': {
36             'font-family': '"Trebuchet MS", Arial, Helvetica, sans-serif',
37             'border-collapse': 'collapse',
38             'border': '1px solid green',
39             'padding': '8px',
40             'text-align': 'center'
41         },
42         'td':
43             {
44                 'border': '1px solid green',
45                 'padding': '8px',
46                 'word-wrap': 'break-all'
47         },
48         'th':
49             {
50                 'background-color': '#EAF2D3',
51                 'border': '1px solid green',
52                 'padding': '8px'
53         }
54     }
55
56     html_settings.set_style(style)
57     LOG.info(html_settings.settings)
58
59
60 if __name__ == '__main__':
61     unit_test()