[svn] / z3 / Five / trunk / tests / test_five.py Repository:
ViewVC logotype

View of /z3/Five/trunk/tests/test_five.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 46891 - (download) (as text) (annotate)
Wed Jun 16 12:54:00 2004 UTC (9 years, 10 months ago) by faassen
File size: 1197 byte(s)
Initial import of Five. This is a cvs export of cvs.infrae.com/Five.
import os, sys

if __name__ == '__main__':
    execfile(os.path.join(sys.path[0], 'framework.py'))

# XXX hack but no other way to initialize options apparently
from Zope.Startup.run import configure
configure('../../../etc/zope.conf')

from Testing import ZopeTestCase

ZopeTestCase.installProduct('Five')
ZopeTestCase.installProduct('FiveTest')

from zope.component import getAdapter
from Products.FiveTest.classes import Adaptable
from Products.FiveTest.interfaces import IAdapted

class FiveTestCase(ZopeTestCase.ZopeTestCase):
    def beforeSetUp(self):
        self.root = self._app()

    def test_adapters(self):
        obj = Adaptable()
        adapted = getAdapter(obj, IAdapted)
        self.assertEquals(
            "Adapted: The method",
            adapted.adaptedMethod())

    def test_adapters2(self):
        obj = Adaptable()
        adapted = IAdapted(obj)
        self.assertEquals(
            "Adapted: The method",
            adapted.adaptedMethod())
        
    
if __name__ == '__main__':
    framework()
else:
    import unittest
    def test_suite():
        suite = unittest.TestSuite()
        suite.addTest(unittest.makeSuite(FiveTestCase))
        return suite

zope.org Infrastructure
ViewVC Help
Powered by ViewVC 1.0.3