[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_pagefolder.py:1.10 test_presentation.py:1.3

Raju Sivalingam sraju at zeomega.com
Thu Dec 18 01:09:45 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv26733/src/zope/app/services/tests

Modified Files:
	test_pagefolder.py test_presentation.py 
Log Message:

  --  ZPT Registration



=== Zope3/src/zope/app/services/tests/test_pagefolder.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/services/tests/test_pagefolder.py:1.9	Fri Nov 21 12:09:42 2003
+++ Zope3/src/zope/app/services/tests/test_pagefolder.py	Thu Dec 18 01:09:44 2003
@@ -17,7 +17,7 @@
 """
 
 from unittest import TestCase, TestSuite, main, makeSuite
-from zope.app import zapi
+from zope.app.tests import ztapi
 from zope.app.tests import setup
 from zope.app.services.tests.placefulsetup import PlacefulSetup
 from zope.app.services.pagefolder import PageFolder, IPageFolder
@@ -30,6 +30,16 @@
      import RegistrationManagerContainerTests
 from zope.component.servicenames import Presentation
 
+
+from zope.app.interfaces.dependable import IDependable
+from zope.app.interfaces.annotation import IAttributeAnnotatable
+from zope.app.dependable import Dependable
+from zope.app import zapi
+from zope.app.interfaces.annotation import IAnnotations, IAnnotatable
+from zope.app.attributeannotations import AttributeAnnotations
+
+
+
 class I(Interface):
     pass
 
@@ -44,23 +54,34 @@
         setup.addService(sm, Presentation, LocalPresentationService(),
                          suffix='service')
         default = zapi.traverse(self.rootFolder, '++etc++site/default')
+
+        ztapi.provideAdapter(IAnnotatable, IAnnotations,
+                         AttributeAnnotations)
+
+        ztapi.provideAdapter(IAnnotatable, IDependable,
+                         Dependable)
+
         default["PF"] = PageFolder()
         pagefolder = zapi.traverse(default, "PF")
+
         pagefolder.required = I
         pagefolder.factoryName = None
         pagefolder.permission = 'zope.View'
 
         self.__pagefolder = pagefolder
 
-    def test___setitem__(self):
 
+
+    def test___setitem__(self):
+        
         pagefolder = self.__pagefolder
 
         pagefolder['foo.html'] = ZPTTemplate()
 
         rm = pagefolder.getRegistrationManager()
         name = rm.keys()[-1]
-        registration = zapi.traverse(pagefolder.getRegistrationManager(), name)
+        registration = zapi.traverse(pagefolder.getRegistrationManager(),
+                                     name)
         self.assertEqual(registration.status, ActiveStatus)
         self.assertEqual(registration.required, I)
         self.assertEqual(registration.requestType, IBrowserRequest)


=== Zope3/src/zope/app/services/tests/test_presentation.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/tests/test_presentation.py:1.2	Fri Nov 21 12:09:59 2003
+++ Zope3/src/zope/app/services/tests/test_presentation.py	Thu Dec 18 01:09:44 2003
@@ -17,6 +17,8 @@
 """
 
 from unittest import TestCase, TestSuite, main, makeSuite
+from zope.testing.doctestunit import DocTestSuite
+from zope.app.tests.placelesssetup import setUp, tearDown
 
 from zope.app import zapi
 from zope.interface import Interface, directlyProvides, implements
@@ -47,6 +49,10 @@
 from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.app.container.contained import contained
 
+from zope.app.interfaces.dependable import IDependable
+from zope.app.interfaces.annotation import IAttributeAnnotatable
+from zope.app.dependable import Dependable
+
 class I1(Interface):
     pass
 
@@ -339,7 +345,7 @@
         registration = contained(
             PageRegistration(
                 I1, 'test', 'zope.View', "Foo.Bar.A", attribute='run'),
-            self.folder,
+            self.folder,6
             )
         c = C()
         request = TestRequest()
@@ -360,6 +366,17 @@
         self.assertRaises(ConfigurationError, lambda: registration.factories)
 
 
+def test_PageRegistration_addremoveNotify():
+    """for addNotify and removeNotify
+
+    XXX
+      - Jim suggested we can write unit test later.
+
+      - It will be easiar to write unit test, for Direct reference.
+
+    """
+
+
 def test_suite():
     return TestSuite([
         makeSuite(TestLocalPresentationService),
@@ -369,3 +386,5 @@
 
 if __name__ == '__main__':
     main(defaultTest='test_suite')
+
+




More information about the Zope3-Checkins mailing list