[Erp5-report] r29731 - /erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 16 09:29:33 CEST 2009


Author: fabien
Date: Fri Oct 16 09:29:31 2009
New Revision: 29731

URL: http://svn.erp5.org?rev=29731&view=rev
Log:
before installing all bt, check if all needed bt paths are present on the file
system. This change permit to not waste time in case of missing bt (you don't
have to wait for all previous bt to be installed to get the error message) and
the time cost of this operation is negligible (less than 0.007 seconds for 52
bt on my 2 cores 2Gb Ram machine)

Modified:
    erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py

Modified: erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py?rev=29731&r1=29730&r2=29731&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py [utf8] Fri Oct 16 09:29:31 2009
@@ -748,6 +748,18 @@
             update_business_templates = os.environ.get('update_business_templates') is not None
             BusinessTemplate_getModifiedObject = aq_base(getattr(portal, 'BusinessTemplate_getModifiedObject', None))
 
+            # check that all bt5 exists, this permit to save time in case of
+            # missing bt
+            missing_bt_list = []
+            from DateTime import DateTime
+            for url, bt_title in business_template_list:
+              # if the bt is not found, an error is raised
+              if not portal.portal_templates.assertBtPathExists(url):
+                missing_bt_list.append(bt_title)
+            if len(missing_bt_list):
+              raise "Some bt can't be found on your system : %r" % \
+                missing_bt_list
+
             # Add some business templates
             for url, bt_title in business_template_list:
               start = time.time()




More information about the Erp5-report mailing list