diff options
| author | qdp <qdp@tinyerp.com> | 2009-01-08 14:03:20 +0100 |
|---|---|---|
| committer | qdp <qdp@tinyerp.com> | 2009-01-08 14:03:20 +0100 |
| commit | 8a06bea953c16c90d4bef269638b5d6b467b89a9 (patch) | |
| tree | c365274f23963f61522737ef1138e6f624c7fffe /addons/base_module_quality/method_test | |
| parent | b141de765db622f36e195261426756a343dd96c7 (diff) | |
base_module_quality improvements:
*added note field
*improved transability
*improved output
*cleaned
*modified format_table method
bzr revid: qdp@tinyerp.com-20090108130320-ypcc4jxbx51jv1ra
Diffstat (limited to 'addons/base_module_quality/method_test')
| -rw-r--r-- | addons/base_module_quality/method_test/method_test.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/addons/base_module_quality/method_test/method_test.py b/addons/base_module_quality/method_test/method_test.py index b9c52279875..1abaa288e86 100644 --- a/addons/base_module_quality/method_test/method_test.py +++ b/addons/base_module_quality/method_test/method_test.py @@ -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: |
