base module quality
bzr revid: mra@tinyerp.com-20081227091014-ds6ad7ylqtfkgi6j
This commit is contained in:
@@ -30,12 +30,13 @@ import pooler
|
||||
class quality_test(base_module_quality.abstract_quality_check):
|
||||
|
||||
def __init__(self):
|
||||
self.result = """
|
||||
===Method Test===:
|
||||
|
||||
This test checks if the module classes are raising exception when calling basic methods or no.
|
||||
|
||||
"""
|
||||
super(quality_test, self).__init__()
|
||||
# self.result = """
|
||||
#===Method Test===:
|
||||
#
|
||||
#This test checks if the module classes are raising exception when calling basic methods or no.
|
||||
#
|
||||
#"""
|
||||
self.bool_installed_only = True
|
||||
return None
|
||||
|
||||
@@ -46,7 +47,6 @@ This test checks if the module classes are raising exception when calling basic
|
||||
result = {}
|
||||
ok_count = 0
|
||||
ex_count = 0
|
||||
|
||||
for obj in obj_list:
|
||||
temp = []
|
||||
try:
|
||||
@@ -71,13 +71,18 @@ This test checks if the module classes are raising exception when calling basic
|
||||
temp.append('Exception')
|
||||
ex_count += 1
|
||||
result[obj] = temp
|
||||
self.result += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-16s \n! %-20s \n! %-16s ') % ('Object Name'.ljust(40), 'search()'.ljust(16), 'fields_view_get()'.ljust(20), 'read()'.ljust(16))
|
||||
|
||||
for res in result:
|
||||
self.result += ('\n|-\n| %s \n| %s \n| %s \n| %s ') % (res, result[res][0],result[res][1], result[res][2])
|
||||
|
||||
self.result += '\n|}'
|
||||
# self.result += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-16s \n! %-20s \n! %-16s ') % ('Object Name'.ljust(40), 'search()'.ljust(16), 'fields_view_get()'.ljust(20), 'read()'.ljust(16))
|
||||
header_list = ['Object Name', 'search()', 'fields_view_get', 'read']
|
||||
# for res in result:
|
||||
# self.result += ('\n|-\n| %s \n| %s \n| %s \n| %s ') % (res, result[res][0],result[res][1], result[res][2])
|
||||
# self.result += '\n|}'
|
||||
self.score = (ok_count + ex_count) and float(ok_count)/float(ok_count + ex_count) or 0.0
|
||||
summary = """\n ===Method Test===:
|
||||
|
||||
This test checks if the module classes are raising exception when calling basic methods or no.
|
||||
|
||||
""" + "Score: " + str(self.score) + "/10\n"
|
||||
self.result = self.format_table(test='method', header=header_list, data_list=[[summary],[result]])
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user