Back to index

plone3  3.1.7
conformance.py
Go to the documentation of this file.
00001 ##############################################################################
00002 #
00003 # Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
00004 #
00005 # This software is subject to the provisions of the Zope Public License,
00006 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
00007 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
00008 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00009 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
00010 # FOR A PARTICULAR PURPOSE.
00011 #
00012 ##############################################################################
00013 """ Base classes for testing interface conformance.
00014 
00015 Derived testcase classes should define '_getTargetClass()', which must
00016 return the class being tested for conformance.
00017 
00018 $Id: conformance.py 40140 2005-11-15 18:53:19Z tseaver $
00019 """
00020 
00021 class ConformsToISetupContext:
00022 
00023     def test_ISetupContext_conformance( self ):
00024 
00025         from Products.GenericSetup.interfaces import ISetupContext
00026         from zope.interface.verify import verifyClass
00027 
00028         verifyClass( ISetupContext, self._getTargetClass() )
00029 
00030 class ConformsToIImportContext:
00031 
00032     def test_IImportContext_conformance( self ):
00033 
00034         from Products.GenericSetup.interfaces import IImportContext
00035         from zope.interface.verify import verifyClass
00036 
00037         verifyClass( IImportContext, self._getTargetClass() )
00038 
00039 class ConformsToIExportContext:
00040 
00041     def test_IExportContext_conformance( self ):
00042 
00043         from Products.GenericSetup.interfaces import IExportContext
00044         from zope.interface.verify import verifyClass
00045 
00046         verifyClass( IExportContext, self._getTargetClass() )
00047 
00048 class ConformsToIStepRegistry:
00049 
00050     def test_IStepRegistry_conformance( self ):
00051 
00052         from Products.GenericSetup.interfaces import IStepRegistry
00053         from zope.interface.verify import verifyClass
00054 
00055         verifyClass( IStepRegistry, self._getTargetClass() )
00056 
00057 class ConformsToIImportStepRegistry:
00058 
00059     def test_IImportStepRegistry_conformance( self ):
00060 
00061         from Products.GenericSetup.interfaces import IImportStepRegistry
00062         from zope.interface.verify import verifyClass
00063 
00064         verifyClass( IImportStepRegistry, self._getTargetClass() )
00065 
00066 class ConformsToIExportStepRegistry:
00067 
00068     def test_IExportStepRegistry_conformance( self ):
00069 
00070         from Products.GenericSetup.interfaces import IExportStepRegistry
00071         from zope.interface.verify import verifyClass
00072 
00073         verifyClass( IExportStepRegistry, self._getTargetClass() )
00074 
00075 class ConformsToIToolsetRegistry:
00076 
00077     def test_IToolsetRegistry_conformance( self ):
00078 
00079         from Products.GenericSetup.interfaces import IToolsetRegistry
00080         from zope.interface.verify import verifyClass
00081 
00082         verifyClass( IToolsetRegistry, self._getTargetClass() )
00083 
00084 class ConformsToIProfileRegistry:
00085 
00086     def test_IProfileRegistry_conformance( self ):
00087 
00088         from Products.GenericSetup.interfaces import IProfileRegistry
00089         from zope.interface.verify import verifyClass
00090 
00091         verifyClass( IProfileRegistry, self._getTargetClass() )
00092 
00093 class ConformsToISetupTool:
00094 
00095     def test_ISetupTool_conformance( self ):
00096 
00097         from Products.GenericSetup.interfaces import ISetupTool
00098         from zope.interface.verify import verifyClass
00099 
00100         verifyClass( ISetupTool, self._getTargetClass() )
00101 
00102 class ConformsToIContentFactory:
00103 
00104     def test_conforms_to_IContentFactory(self):
00105 
00106         from Products.GenericSetup.interfaces import IContentFactory
00107         from zope.interface.verify import verifyClass
00108 
00109         verifyClass( IContentFactory, self._getTargetClass() )
00110 
00111 class ConformsToIContentFactoryName:
00112 
00113     def test_conforms_to_IContentFactory(self):
00114 
00115         from Products.GenericSetup.interfaces import IContentFactoryName
00116         from zope.interface.verify import verifyClass
00117 
00118         verifyClass( IContentFactoryName, self._getTargetClass() )
00119 
00120 class ConformsToIFilesystemExporter:
00121 
00122     def test_conforms_to_IFilesystemExporter(self):
00123 
00124         from Products.GenericSetup.interfaces import IFilesystemExporter
00125         from zope.interface.verify import verifyClass
00126 
00127         verifyClass( IFilesystemExporter, self._getTargetClass() )
00128 
00129 class ConformsToIFilesystemImporter:
00130 
00131     def test_conforms_to_IFilesystemImporter(self):
00132 
00133         from Products.GenericSetup.interfaces import IFilesystemImporter
00134         from zope.interface.verify import verifyClass
00135 
00136         verifyClass( IFilesystemImporter, self._getTargetClass() )
00137 
00138 class ConformsToIINIAware:
00139 
00140     def test_conforms_to_IINIAware(self):
00141 
00142         from Products.GenericSetup.interfaces import IINIAware
00143         from zope.interface.verify import verifyClass
00144 
00145         verifyClass (IINIAware, self._getTargetClass() )
00146 
00147 class ConformsToICSVAware:
00148 
00149     def test_conforms_to_ICSVAware(self):
00150 
00151         from Products.GenericSetup.interfaces import ICSVAware
00152         from zope.interface.verify import verifyClass
00153 
00154         verifyClass( ICSVAware, self._getTargetClass() )
00155 
00156 class ConformsToIDAVAware:
00157 
00158     def test_conforms_to_IDAVAware(self):
00159 
00160         from Products.GenericSetup.interfaces import IDAVAware
00161         from zope.interface.verify import verifyClass
00162 
00163         verifyClass( IDAVAware, self._getTargetClass() )