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 39167 2007-03-15 15:11:39Z shh42 $
00006 
00007 import os, sys
00008 if __name__ == '__main__':
00009     execfile(os.path.join(sys.path[0], 'framework.py'))
00010 
00011 from Products.PloneTestCase import PloneTestCase
00012 from Products.PloneTestCase import setup
00013 from Products.PloneTestCase.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 TestPloneTestCase(PloneTestCase.PloneTestCase):
00024 
00025     _configure_portal = 0
00026 
00027     def _portal(self):
00028         return None
00029 
00030     def testIPortalTestCase(self):
00031         self.failUnless(verifyClass(IPortalTestCase, PloneTestCase.PloneTestCase))
00032         self.failUnless(verifyObject(IPortalTestCase, self))
00033 
00034     def testIPloneTestCase(self):
00035         self.failUnless(verifyClass(IPloneTestCase, PloneTestCase.PloneTestCase))
00036         self.failUnless(verifyObject(IPloneTestCase, self))
00037 
00038     def testIPloneSecurity(self):
00039         self.failUnless(verifyClass(IPloneSecurity, PloneTestCase.PloneTestCase))
00040         self.failUnless(verifyObject(IPloneSecurity, self))
00041 
00042 
00043 class TestFunctionalTestCase(PloneTestCase.FunctionalTestCase):
00044 
00045     _configure_portal = 0
00046 
00047     def _portal(self):
00048         return None
00049 
00050     def testIFunctional(self):
00051         self.failUnless(verifyClass(IFunctional, PloneTestCase.FunctionalTestCase))
00052         self.failUnless(verifyObject(IFunctional, self))
00053 
00054     def testIPortalTestCase(self):
00055         self.failUnless(verifyClass(IPortalTestCase, PloneTestCase.FunctionalTestCase))
00056         self.failUnless(verifyObject(IPortalTestCase, self))
00057 
00058     def testIPloneTestCase(self):
00059         self.failUnless(verifyClass(IPloneTestCase, PloneTestCase.FunctionalTestCase))
00060         self.failUnless(verifyObject(IPloneTestCase, self))
00061 
00062     def testIPloneSecurity(self):
00063         self.failUnless(verifyClass(IPloneSecurity, PloneTestCase.FunctionalTestCase))
00064         self.failUnless(verifyObject(IPloneSecurity, self))
00065 
00066 
00067 def test_suite():
00068     from unittest import TestSuite, makeSuite
00069     suite = TestSuite()
00070     suite.addTest(makeSuite(TestPloneTestCase))
00071     suite.addTest(makeSuite(TestFunctionalTestCase))
00072     return suite
00073 
00074 if __name__ == '__main__':
00075     framework()
00076