[Erp5-report] r29315 - /erp5/trunk/products/ERP5/tests/testERP5Interfaces.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Sep 30 13:13:09 CEST 2009
Author: luke
Date: Wed Sep 30 13:13:08 2009
New Revision: 29315
URL: http://svn.erp5.org?rev=29315&view=rev
Log:
- fix typo
- as common parts are moved to testERP5TypeInterfaces import them from there
Modified:
erp5/trunk/products/ERP5/tests/testERP5Interfaces.py
Modified: erp5/trunk/products/ERP5/tests/testERP5Interfaces.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5Interfaces.py?rev=29315&r1=29314&r2=29315&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5Interfaces.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testERP5Interfaces.py [utf8] Wed Sep 30 13:13:08 2009
@@ -7,7 +7,7 @@
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
-# guarantees and support are strongly adviced to contract a Free Software
+# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
@@ -27,6 +27,8 @@
##############################################################################
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
+from Products.ERP5Type.tests.testERP5TypeInterfaces import makeTestMethod, \
+ addTestMethodDynamically
from zope.interface.verify import verifyClass
import unittest
@@ -91,30 +93,6 @@
import IAggregatedAmountList
from Products.ERP5.AggregatedAmountList import AggregatedAmountList
verifyClass(IAggregatedAmountList, AggregatedAmountList)
-
-def makeTestMethod(document, interface):
- """Common method which checks if documents implements interface"""
- def testMethod(self):
- _temp = __import__('Products.ERP5Type.Document.%s' % document, globals(),
- locals(), ['%s' % document])
- Document = getattr(_temp, document)
- _temp = __import__('Products.ERP5Type.interfaces', globals(), locals(),
- ['%s' % interface])
- Interface = getattr(_temp, interface)
-
- verifyClass(Interface, Document)
-
- return testMethod
-
-def addTestMethodDynamically():
- """Creates test methods on the fly
-
- Uses naming test_TradeCondition_implements_ITransformation
- It is possible to use --run_only on those dynamically generated methods"""
- for document, interface in implements_tuple_list:
- method_name = 'test_%s_implements_%s' % (document, interface)
- method = makeTestMethod(document, interface)
- setattr(TestERP5Interfaces, method_name, method)
addTestMethodDynamically()
More information about the Erp5-report
mailing list