base_module_quality improvements:
*added note field *improved transability *improved output *cleaned *modified format_table method bzr revid: qdp@tinyerp.com-20090108130320-ypcc4jxbx51jv1ra
This commit is contained in:
@@ -32,6 +32,9 @@ class quality_test(base_module_quality.abstract_quality_check):
|
||||
def __init__(self):
|
||||
super(quality_test, self).__init__()
|
||||
self.name = _("Method Test")
|
||||
self.note = _("""
|
||||
This test checks if the module classes are raising exception when calling basic methods or not.
|
||||
""")
|
||||
self.bool_installed_only = True
|
||||
self.ponderation = 1.0
|
||||
return None
|
||||
@@ -47,38 +50,32 @@ class quality_test(base_module_quality.abstract_quality_check):
|
||||
temp = [obj]
|
||||
try:
|
||||
res = pool.get(obj).search(cr, uid, [])
|
||||
temp.append('Ok')
|
||||
temp.append(_('Ok'))
|
||||
ok_count += 1
|
||||
except:
|
||||
temp.append('Exception')
|
||||
temp.append(_('Exception'))
|
||||
ex_count += 1
|
||||
try:
|
||||
res1 = pool.get(obj).fields_view_get(cr, uid,)
|
||||
temp.append('Ok')
|
||||
temp.append(_('Ok'))
|
||||
ok_count += 1
|
||||
except:
|
||||
temp.append('Exception')
|
||||
temp.append(_('Exception'))
|
||||
ex_count += 1
|
||||
try:
|
||||
res2 = pool.get(obj).read(cr, uid, [])
|
||||
temp.append('Ok')
|
||||
temp.append(_('Ok'))
|
||||
ok_count += 1
|
||||
except:
|
||||
temp.append('Exception')
|
||||
temp.append(_('Exception'))
|
||||
ex_count += 1
|
||||
result_dict[obj] = temp
|
||||
self.score = (ok_count + ex_count) and float(ok_count)/float(ok_count + ex_count) or 0.0
|
||||
self.result = self.get_result()
|
||||
self.result_details = self.get_result_details(result_dict)
|
||||
self.result = self.get_result(result_dict)
|
||||
return None
|
||||
|
||||
def get_result(self):
|
||||
summary = """
|
||||
This test checks if the module classes are raising exception when calling basic methods or not.
|
||||
"""
|
||||
return summary
|
||||
|
||||
def get_result_details(self, dict):
|
||||
def get_result(self, dict):
|
||||
header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-16s \n! %-20s \n! %-16s ', [_('Object Name'), 'search()', 'fields_view_get()', 'read()'])
|
||||
detail = ""
|
||||
if not self.error:
|
||||
|
||||
Reference in New Issue
Block a user