summaryrefslogtreecommitdiff
path: root/addons/base_module_quality/method_test
diff options
context:
space:
mode:
authormra (Open ERP) <mra@tinyerp.com>2009-01-16 14:33:55 +0530
committermra (Open ERP) <mra@tinyerp.com>2009-01-16 14:33:55 +0530
commit9b1c726b9df5e98c05ba9102904b3a5c5e9b0d9e (patch)
tree57b17a9866f421235836c73755d1a87895ebc831 /addons/base_module_quality/method_test
parentb5800e1e21317740d25c89227e26aadcc2a306a6 (diff)
base_module_quality moved from addons to trunk-extra-addons
bzr revid: mra@tinyerp.com-20090116090355-ayit2uufsgdycjib
Diffstat (limited to 'addons/base_module_quality/method_test')
-rw-r--r--addons/base_module_quality/method_test/__init__.py24
-rw-r--r--addons/base_module_quality/method_test/method_test.py84
2 files changed, 0 insertions, 108 deletions
diff --git a/addons/base_module_quality/method_test/__init__.py b/addons/base_module_quality/method_test/__init__.py
deleted file mode 100644
index cfc1f614751..00000000000
--- a/addons/base_module_quality/method_test/__init__.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_module_quality/method_test/method_test.py b/addons/base_module_quality/method_test/method_test.py
deleted file mode 100644
index 34841dd41cc..00000000000
--- a/addons/base_module_quality/method_test/method_test.py
+++ /dev/null
@@ -1,84 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-from tools.translate import _
-
-from base_module_quality import base_module_quality
-import pooler
-
-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
-
- def run_test(self, cr, uid, module_path):
- pool = pooler.get_pool(cr.dbname)
- module_name = module_path.split('/')[-1]
- obj_list = self.get_objects(cr, uid, module_name)
- ok_count = 0
- ex_count = 0
- result_dict = {}
- for obj in obj_list:
- temp = [obj]
- try:
- res = pool.get(obj).search(cr, uid, [])
- temp.append(_('Ok'))
- ok_count += 1
- except:
- temp.append(_('Exception'))
- ex_count += 1
- try:
- res1 = pool.get(obj).fields_view_get(cr, uid,)
- temp.append(_('Ok'))
- ok_count += 1
- except:
- temp.append(_('Exception'))
- ex_count += 1
- try:
- res2 = pool.get(obj).read(cr, uid, [])
- temp.append(_('Ok'))
- ok_count += 1
- except:
- 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(result_dict)
- return None
-
-
- 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:
- detail += self.format_table(header, dict)
- return detail
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-