testERP5Interfaces.py 4.73 KB
Newer Older
1
# -*- coding: utf-8 -*-
2 3 4 5 6 7 8 9
##############################################################################
# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved.
#          Łukasz Nowak <luke@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# 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
Łukasz Nowak's avatar
Łukasz Nowak committed
10
# guarantees and support are strongly advised to contract a Free Software
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
# Service Company
#
# 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 2
# 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################

from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
30
from Products.ERP5Type.tests.testERP5TypeInterfaces import addTestMethodDynamically
31 32
import unittest

33 34 35
# this list can be generated automatically using introspection or can be set
# manually and treated as reference to what implements what
implements_tuple_list = [
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
  (('Products.ERP5Type.Document.BusinessPath','BusinessPath'), 'IArrowBase'),
  (('Products.ERP5Type.Document.BusinessPath','BusinessPath'), 'IBusinessPath'),
  (('Products.ERP5Type.Document.BusinessPath','BusinessPath'), 'ICategoryAccessProvider'),
  (('Products.ERP5Type.Document.DeliveryLine', 'DeliveryLine'), 'IDivergenceSolver'),
  (('Products.ERP5Type.Document.TradeCondition','TradeCondition'), 'ITransformation'),
  (('Products.ERP5Type.Document.TradeModelCell','TradeModelCell'), 'ITransformation'),
  (('Products.ERP5Type.Document.TradeModelCell','TradeModelCell'), 'IVariated'),
  (('Products.ERP5Type.Document.TradeModelLine','TradeModelLine'), 'ITransformation'),
  (('Products.ERP5Type.Document.TradeModelLine','TradeModelLine'), 'IVariated'),
  (('Products.ERP5Type.Document.TradeModelRule','TradeModelRule'), 'IPredicate'),
  (('Products.ERP5Type.Document.TradeModelRule','TradeModelRule'), 'IRule'),
  (('Products.ERP5Type.Document.Transformation','Transformation'), 'ITransformation'),
  (('Products.ERP5Type.Document.Transformation','Transformation'), 'IVariated'),
  (('Products.ERP5Type.Document.TransformationRule','TransformationRule'), 'IPredicate'),
  (('Products.ERP5Type.Document.TransformationRule','TransformationRule'), 'IRule'),
  (('Products.ERP5Type.Document.TransformedResource','TransformedResource'), 'IVariated'),
52
  #IDocument
53 54 55 56 57 58 59 60 61
  (('Products.ERP5Type.Document.Document', 'Document'), 'IDocument'),
  (('Products.ERP5Type.Document.Image', 'Image'), 'IDocument'),
  (('Products.ERP5Type.Document.File', 'File'), 'IDocument'),
  (('Products.ERP5Type.Document.OOoDocument', 'OOoDocument'), 'IDocument'),
  (('Products.ERP5Type.Document.TextDocument', 'TextDocument'), 'IDocument'),
  (('Products.ERP5Type.Document.EmailDocument', 'EmailDocument'), 'IDocument'),
  (('Products.ERP5Type.Document.Event', 'Event'), 'IDocument'),
  # IAggregatedAmountList
  (('Products.ERP5.AggregatedAmountList', 'AggregatedAmountList'), 'IAggregatedAmountList'),
62
]
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
# IMovementGroup
for movement_group_class_name in ['MovementGroup', 'BaseVariantMovementGroup',
    'CategoryMovementGroup', 'CausalityAssignmentMovementGroup',
    'CausalityMovementGroup', 'DayMovementGroup',
    'DeliveryCausalityAssignmentMovementGroup', 'FirstCausalityMovementGroup',
    'MonthlyRangeMovementGroup', 'NestedLineMovementGroup',
    'OrderMovementGroup', 'ParentExplanationMovementGroup',
    'PropertyAssignmentMovementGroup', 'PropertyMovementGroup',
    'QuantitySignMovementGroup', 'RequirementMovementGroup',
    'RootAppliedRuleCausalityMovementGroup', 'SplitMovementGroup',
    'TaxLineDeliveryMovementGroup', 'TitleMovementGroup',
    'VariantMovementGroup', 'VariationPropertyMovementGroup']:
  implements_tuple_list.append((('Products.ERP5Type.Document.%s' % \
      movement_group_class_name, movement_group_class_name),
      'IMovementGroup'))
78 79

class TestERP5Interfaces(ERP5TypeTestCase):
80
  """Tests implementation of interfaces"""
81

82
addTestMethodDynamically(TestERP5Interfaces, implements_tuple_list)
83 84 85 86 87

def test_suite():
  suite = unittest.TestSuite()
  suite.addTest(unittest.makeSuite(TestERP5Interfaces))
  return suite