[IMP] base_module_quality: modify all tests result display for buildpot, use class on tag instead of css file

bzr revid: mra@tinyerp.com-20090924122448-iw771j32awal2b2u
This commit is contained in:
mra (Open ERP) 2009-09-24 17:54:48 +05:30
parent f838384213
commit 48cad35492
6 changed files with 128 additions and 15 deletions

View File

@ -184,9 +184,24 @@ Test checks for fields, views, security rules, dependancy level
def get_result_details(self, dict_obj):
res = ""
if dict_obj != {}:
str_html = '''<html><strong> Fields Result</strong><head></head><body>'''
str_html = '''<html><strong> Fields Result</strong><head>
<style>
.bstyle
{
border-width:2px;
border-style:dashed;
border-color: gray;
}
.btstyle
{
border-width:2px;
border-style:solid;
border-color: gray;
}
}
</style></head><body>'''
res += str_html
header = ('<tr><th width="200">%s</th><th width="200">%s</th><th width="300">%s</th></tr>', [_('Object Name'), _('Field name'), _('Suggestion')])
header = ('<tr><th class="btstyle">%s</th><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('Object Name'), _('Field name'), _('Suggestion')])
if not self.error:
for key in dict_obj.keys():
data_list = []
@ -196,15 +211,32 @@ Test checks for fields, views, security rules, dependancy level
for i in data_list:
count = count + 1
final_dict[key + str(count)] = i
res += '<table>' + self.format_html_table(header, data_list=final_dict) + '</table><br>'
res_str = '<table class="bstyle">' + self.format_html_table(header, data_list=final_dict) + '</table><br>'
res += res_str.replace('''<td''', '''<td class="btstyle" ''')
return res + '</body></html>'
return ""
def get_result_general(self, dict_obj, name=''):
str_html = '''<html><strong> %s Result</strong><head></head><body><table>'''% (name)
header = ('<tr><th>%s</th><th>%s</th></tr>', [_('Object Name'), _('Suggestion')])
str_html = '''<html><strong> %s Result</strong><head>
<style>
.bstyle
{
border-width:2px;
border-style:dashed;
border-color: gray;
}
.btstyle
{
border-width:2px;
border-style:solid;
border-color: gray;
}
}
</style></head><body><table class="bstyle">'''% (name)
header = ('<tr><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('Object Name'), _('Suggestion')])
if not self.error:
res = str_html + self.format_html_table(header, data_list=dict_obj) + '</table></body></html>'
res = res.replace('''<td''', '''<td class="btstyle" ''')
return res
return ""

View File

@ -271,10 +271,27 @@ PEP-8 Test , copyright of py files check, method can not call from loops
return ""
def get_result_general(self, dict_obj):
str_html = '''<html><strong>Result</strong><head></head><body><table>'''
header = ('<tr><th>%s</th><th>%s</th><th>%s</th></tr>', [_('Object Name'), _('Line number'), _('Suggestion')])
str_html = '''<html><strong>Result</strong><head>
<style>
.bstyle
{
border-width:2px;
border-style:dashed;
border-color: gray;
}
.btstyle
{
border-width:2px;
border-style:solid;
border-color: gray;
}
}
</style>
</head><body><table class="bstyle">'''
header = ('<tr><th class="btstyle">%s</th><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('Object Name'), _('Line number'), _('Suggestion')])
if not self.error:
res = str_html + self.format_html_table(header, data_list=dict_obj) + '</table></body></html>'
res = res.replace('''<td''', '''<td class="btstyle" ''')
return res
return ""

View File

@ -125,10 +125,26 @@ This test checks the speed of the module. Note that at least 5 demo data is need
return ""
def get_result_details(self, dict_speed):
str_html = '''<html><head></head><body><table border="1">'''
header = ('<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')])
str_html = '''<html><head>
<style>
.bstyle
{
border-width:2px;
border-style:dashed;
border-color: gray;
}
.btstyle
{
border-width:2px;
border-style:solid;
border-color: gray;
}
}
</style></head><body><table class="bstyle">'''
header = ('<tr><th class="btstyle" >%s</th><th class="btstyle">%s</th><th class="btstyle">%s</th><th class="btstyle">%s</th><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')])
if not self.error:
res = str_html + self.format_html_table(header, data_list=dict_speed) + '</table></body></html>'
res = res.replace('''<td''', '''<td class="btstyle" ''')
return res
return ""

View File

@ -170,10 +170,26 @@ This test checks if the module satisfy tiny structure
return score
def get_result_details(self, dict_struct):
str_html = '''<html><head></head><body><table>'''
header = ('<tr><th>%s</th><th>%s</th></tr>', [_('File Name'), _('Feedback about structure of module')])
str_html = '''<html><head>
<style>
.bstyle
{
border-width:2px;
border-style:dashed;
border-color: gray;
}
.btstyle
{
border-width:2px;
border-style:solid;
border-color: gray;
}
}
</style></head><body><table class="bstyle">'''
header = ('<tr><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('File Name'), _('Feedback about structure of module')])
if not self.error:
res = str_html + self.format_html_table(header, data_list=dict_struct) + '</table></body></html>'
res = res.replace('''<td''', '''<td class="btstyle" ''')
return res
return ""

View File

@ -137,10 +137,26 @@ class quality_test(base_module_quality.abstract_quality_check):
def get_result_details(self, dict_terp):
if dict_terp:
str_html = '''<html><head></head><body><table border="1">'''
header = ('<tr><th>%s</th><th>%s</th></tr>', [_('Tag Name'), _('Feed back About terp file of Module')])
str_html = '''<html><head>
<style>
.bstyle
{
border-width:2px;
border-style:dashed;
border-color: gray;
}
.btstyle
{
border-width:2px;
border-style:solid;
border-color: gray;
}
}
</style></head><body><table class="bstyle">'''
header = ('<tr><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('Tag Name'), _('Feed back About terp file of Module')])
if not self.error:
res = str_html + self.format_html_table(header, data_list=dict_terp) + '</table><newline/></body></html>'
res = res.replace('''<td''', '''<td class="btstyle" ''')
return res
return ""

View File

@ -134,10 +134,26 @@ class quality_test(base_module_quality.abstract_quality_check):
return ""
def get_result_details(self, dict_wf):
str_html = '''<html><head></head><body><table border="1">'''
header = ('<tr><th>%s</th><th>%s</th></tr>', [_('Object Name'), _('Feed back About Workflow of Module')])
str_html = '''<html><head>
<style>
.bstyle
{
border-width:2px;
border-style:dashed;
border-color: gray;
}
.btstyle
{
border-width:2px;
border-style:solid;
border-color: gray;
}
}
</style></head><body><table class="bstyle">'''
header = ('<tr><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('Object Name'), _('Feed back About Workflow of Module')])
if not self.error:
res = str_html + self.format_html_table(header, data_list=dict_wf) + '</table><newline/></body></html>'
res = res.replace('''<td''', '''<td class="btstyle" ''')
return res
return ""