Back to index

plone3  3.1.7
testInterfaces.py
Go to the documentation of this file.
00001 #
00002 # Interface tests
00003 #
00004 
00005 # $Id: testInterfaces.py 39166 2007-03-15 15:11:23Z shh42 $
00006 
00007 import os, sys
00008 if __name__ == '__main__':
00009     execfile(os.path.join(sys.path[0], 'framework.py'))
00010 
00011 from Products.CMFTestCase import CMFTestCase
00012 from Products.CMFTestCase import setup
00013 from Products.CMFTestCase.interfaces import *
00014 
00015 if setup.Z3INTERFACES:
00016     from zope.interface.verify import verifyClass
00017     from zope.interface.verify import verifyObject
00018 else:
00019     from Interface.Verify import verifyClass
00020     from Interface.Verify import verifyObject
00021 
00022 
00023 class TestCMFTestCase(CMFTestCase.CMFTestCase):
00024 
00025     _configure_portal = 0
00026 
00027     def _portal(self):
00028         return None
00029 
00030     def testIPortalTestCase(self):
00031         self.failUnless(verifyClass(IPortalTestCase, CMFTestCase.CMFTestCase))
00032         self.failUnless(verifyObject(IPortalTestCase, self))
00033 
00034     def testICMFTestCase(self):
00035         self.failUnless(verifyClass(ICMFTestCase, CMFTestCase.CMFTestCase))
00036         self.failUnless(verifyObject(ICMFTestCase, self))
00037 
00038     def testICMFSecurity(self):
00039         self.failUnless(verifyClass(ICMFSecurity, CMFTestCase.CMFTestCase))
00040         self.failUnless(verifyObject(ICMFSecurity, self))
00041 
00042 
00043 class TestFunctionalTestCase(CMFTestCase.FunctionalTestCase):
00044 
00045     _configure_portal = 0
00046 
00047     def _portal(self):
00048         return None
00049 
00050     def testIFunctional(self):
00051         self.failUnless(verifyClass(IFunctional, CMFTestCase.FunctionalTestCase))
00052         self.failUnless(verifyObject(IFunctional, self))
00053 
00054     def testIPortalTestCase(self):
00055         self.failUnless(verifyClass(IPortalTestCase, CMFTestCase.FunctionalTestCase))
00056         self.failUnless(verifyObject(IPortalTestCase, self))
00057 
00058     def testICMFTestCase(self):
00059         self.failUnless(verifyClass(ICMFTestCase, CMFTestCase.FunctionalTestCase))
00060         self.failUnless(verifyObject(ICMFTestCase, self))
00061 
00062     def testICMFSecurity(self):
00063         self.failUnless(verifyClass(ICMFSecurity, CMFTestCase.FunctionalTestCase))
00064         self.failUnless(verifyObject(ICMFSecurity, self))
00065 
00066 
00067 def test_suite():
00068     from unittest import TestSuite, makeSuite
00069     suite = TestSuite()
00070     suite.addTest(makeSuite(TestCMFTestCase))
00071     suite.addTest(makeSuite(TestFunctionalTestCase))
00072     return suite
00073 
00074 if __name__ == '__main__':
00075     framework()
00076