#Specify test got an error on module
self.error = False
- #The tests have to subscribe itselfs in this list, that contains all the test that have to be performed.
+ #The tests have to subscribe itselfs in this list, that contains all the test that have to be performed.
self.tests = []
self.list_folders = os.listdir(config['addons_path']+'/base_module_quality/')
for item in self.list_folders:
def __init__(self):
super(quality_test, self).__init__()
+ self.name = _("Method Test")
self.bool_installed_only = True
self.ponderation = 1.0
self.result_det = {}
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()
-
return None
-
def get_result(self):
summary = """
-===Method Test===:
-
This test checks if the module classes are raising exception when calling basic methods or no.
-
-""" + "Score: " + str(self.score) + "/10\n"
+"""
return summary
def get_result_details(self):
header_list = ['method', 'Object Name', 'search()', 'fields_view_get', 'read']
- detail = "\n===Method Test===\n"
+ detail = "" #"\n===Method Test===\n"
if not self.error:
detail += self.format_table(header=header_list, data_list=[self.result_det])
return detail
n = 0
score = 0.0
+ self.result += "\nThis test checks if the module satisfies the current coding standard used by OpenERP. \n\n"
for file in list_files:
if file.split('.')[-1] == 'py' and not file.endswith('__init__.py') and not file.endswith('__terp__.py'):
file_path = os.path.join(module_path, file)
def __init__(self):
super(quality_test, self).__init__()
+ self.name = _("Speed Test")
self.bool_installed_only = True
self.ponderation = 1.0
self.listdata = []
list = [obj, size, "", "", "", "Warning! Object has no demo data"]
self.listdata.append(list)
self.score = obj_counter and score/obj_counter or 0.0
- return None
+ self.result = self.get_result()
+ self.result_details = self.get_result_details()
- def get_result(self, cr, uid, module_path, module_state):
- self.run_test(cr, uid, module_path)
- if not self.bool_installed_only or module_state=="installed":
- summary = """
-===Speed Test===:
+ return None
+ def get_result(self):
+## self.run_test(cr, uid, module_path)
+# if not self.bool_installed_only or module_state=="installed":
+ summary = """
This test checks the speed of the module.
-""" + "Score: " + str(self.score) + "/10\n"
- else:
- summary =""" \n===Speed Test===:
-
-The module has to be installed before running this test.\n\n """
- header_list = ""
- self.error = True
+"""
+# else:
+# summary =""" \n===Speed Test===:
+#
+#The module has to be installed before running this test.\n\n """
+# header_list = ""
+# self.error = True
return summary
- def get_result_detail(self):
+ def get_result_details(self):
header_list = ['speed', 'Object Name', 'Size-Number of Records (S)', '1', 'S/2', 'S', 'Complexity using query']
detail = ""
- detail += "\n===Speed Test===\n"
+# detail += "\n===Speed Test===\n"
if not self.error:
detail += self.format_table(header=header_list, data_list=[self.listdata])
return detail
class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
- '''
- This test checks the quality of __terp__.py file in the selected module.
- '''
+# '''
+# This test checks the quality of __terp__.py file in the selected module.
+# '''
super(quality_test, self).__init__()
+ self.name = _("Terp Test")
self.bool_installed_only = False
self.no_terp = False
self.ponderation = 2
feel_bad_factor = 0
if '__terp__.py' not in list_files:
self.no_terp = True
+ if self.no_terp:
+ self.result += "The module does not contain the __terp__.py file"
+
terp_file = os.path.join(module_path,'__terp__.py')
res = eval(tools.file_open(terp_file).read())
feel_bad_factor += 1
self.score = round((feel_good_factor) / float(feel_good_factor + feel_bad_factor),2)
- self.result += "__terp__.py : "+ str(self.score) + "/10\n"
+ self.result += "\nThis test checks if the module satisfies the current coding standard for __terp__.py file used by OpenERP."
+# self.result += "__terp__.py : "+ str(self.score) + "/10\n"
return None
def get_result(self, cr, uid, module_path, module_state):
- self.run_test(cr, uid, module_path)
- summary = "\n===TERP Test===:\n"
+# self.run_test(cr, uid, module_path)
+# summary = "\n===TERP Test===:\n"
if self.no_terp:
summary += """
The module does not contain the __terp__.py file.\n\n """
- else:
- summary += """
- This test checks if the module satisfies the current coding standard for __terp__.py file used by OpenERP.
- """ + "Score: " + str(self.score) + "/10\n"
+# else:
+# summary += """
+# This test checks if the module satisfies the current coding standard for __terp__.py file used by OpenERP.
+# """ + "Score: " + str(self.score) + "/10\n"
return summary
def get_result_details(self):