summaryrefslogtreecommitdiff
path: root/addons/base_module_quality/base_module_quality.py
diff options
context:
space:
mode:
authormra (Open ERP) <mra@tinyerp.com>2008-12-27 14:40:14 +0530
committermra (Open ERP) <mra@tinyerp.com>2008-12-27 14:40:14 +0530
commit06882ed8a0c5bd9c660e9a87f11c0a5af0ab93e4 (patch)
treeae6804acc68cc02dfd77d79abea0b90565c35aa3 /addons/base_module_quality/base_module_quality.py
parent988263fd7cdac8eefd6ebbc96e0074b0391c4a87 (diff)
base module quality
bzr revid: mra@tinyerp.com-20081227091014-ds6ad7ylqtfkgi6j
Diffstat (limited to 'addons/base_module_quality/base_module_quality.py')
-rw-r--r--addons/base_module_quality/base_module_quality.py78
1 files changed, 60 insertions, 18 deletions
diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py
index ef4a0c3c515..101043b498c 100644
--- a/addons/base_module_quality/base_module_quality.py
+++ b/addons/base_module_quality/base_module_quality.py
@@ -26,34 +26,51 @@ class abstract_quality_check(object):
This Class provide...
'''
- #This float have to store the rating of the module.
- #Used to compute the final score (average of all scores).
- score = 0.0
-
- #This char have to store the result.
- #Used to display the result of the test.
- result = ""
-
- #This char have to store the result with more details.
- #Used to provide more details if necessary.
- result_details = ""
-
- #This bool defines if the test can be run only if the module is installed.
- #True => the module have to be installed.
- #False => the module can be uninstalled.
- bool_installed_only = True
+# #This float have to store the rating of the module.
+# #Used to compute the final score (average of all scores).
+# score = 0.0
+#
+# #This char have to store the result.
+# #Used to display the result of the test.
+# result = ""
+#
+# #This char have to store the result with more details.
+# #Used to provide more details if necessary.
+# result_details = ""
+#
+# #This bool defines if the test can be run only if the module is installed.
+# #True => the module have to be installed.
+# #False => the module can be uninstalled.
+# bool_installed_only = True
def __init__(self):
'''
this method should initialize the var
'''
- raise 'Not Implemented'
+ #This float have to store the rating of the module.
+ #Used to compute the final score (average of all scores).
+ self.score = 0.0
+
+ #This char have to store the result.
+ #Used to display the result of the test.
+ self.result = ""
+
+ #This char have to store the result with more details.
+ #Used to provide more details if necessary.
+ self.result_details = ""
+
+ #This bool defines if the test can be run only if the module is installed.
+ #True => the module have to be installed.
+ #False => the module can be uninstalled.
+ self.bool_installed_only = True
+
+# raise 'Not Implemented'
def run_test(self, cr, uid, module_path=""):
'''
this method should do the test and fill the score, result and result_details var
'''
- raise 'Not Implemented'
+# raise 'Not Implemented'
def get_objects(self, cr, uid, module):
# This function returns all object of the given module..
@@ -77,5 +94,30 @@ class abstract_quality_check(object):
result_ids[obj] = ids
return result_ids
+ def format_table(self, test='', header=[], data_list=[]):
+ res_format = {}
+ if test=='method':
+ detail = ""
+ detail += "\n===Method Test===\n"
+ detail += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-16s \n! %-20s \n! %-16s ') % (header[0].ljust(40), header[1].ljust(16), header[2].ljust(20), header[3].ljust(16))
+ for res in data_list[1][0]:
+ detail += ('\n|-\n| %s \n| %s \n| %s \n| %s ') % (res, data_list[1][0][res][0], data_list[1][0][res][1], data_list[1][0][res][2])
+ res_format['summary'] = [data_list[0][0]]
+ res_format['detail'] = [detail + '\n|}']
+ elif test=='pylint':
+ res_format['summary'] = data_list[0]
+ res_format['detail'] = data_list[1]
+ elif test=='speed':
+ detail = ""
+ detail += "\n===Speed Test===\n"
+ detail += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n! %-10s \n! %-10s \n! %-10s \n! %-20s') % (header[0].ljust(40), header[1].ljust(10), header[2].ljust(10), header[3].ljust(10), header[4].ljust(10), header[5].ljust(20))
+ for data in data_list[1]:
+ detail += ('\n|-\n| %s \n| %s \n| %s \n| %s \n| %s \n| %s ') % (data[0], data[1], data[2], data[3], data[4], data[5])
+ res_format['summary'] = data_list[0]
+ res_format['detail'] = [detail + '\n|}\n']
+ return res_format
+
+
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: