[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser/tests - test_addMenuItem.py:1.4

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Mar 9 07:39:40 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/publisher/browser/tests
In directory cvs.zope.org:/tmp/cvs-serv9939/src/zope/app/publisher/browser/tests

Modified Files:
	test_addMenuItem.py 
Log Message:


Adjusted code to use utility service to look up factories or use the new zapi
methods.




=== Zope3/src/zope/app/publisher/browser/tests/test_addMenuItem.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/publisher/browser/tests/test_addMenuItem.py:1.3	Wed Mar  3 05:38:49 2004
+++ Zope3/src/zope/app/publisher/browser/tests/test_addMenuItem.py	Tue Mar  9 07:39:07 2004
@@ -11,27 +11,32 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-'''Test the addMenuItem directive
+"""Test the addMenuItem directive
 
 >>> test_reset()
 >>> context = Context()
 >>> addMenuItem(context, class_=X, title="Add an X",
 ...             permission="zope.ManageContent")
 >>> context
-((('FactoryFromClass', 'zope.app.browser.add.X.f1'),
-  <function provideClass>,
-  ('zope.app.browser.add.X.f1',
-   <class zope.app.publisher.browser.tests.test_addMenuItem.X>,
-   'zope.ManageContent',
-   '',
-   '')),
+((('utility',
+   <InterfaceClass zope.component.interfaces.IFactory>,
+   'zope.app.browser.add.X.f1'),
+  <function checkingHandler>,
+  (Global(CheckerPublic,zope.security.checker),
+   'Utilities',
+   'provideUtility',
+   <InterfaceClass zope.component.interfaces.IFactory>,
+   <zope.component.factory.Factory object>,
+   'zope.app.browser.add.X.f1')),
+ (None,
+  <function provideInterface>,
+  ('zope.component.interfaces.IFactory',
+   <InterfaceClass zope.component.interfaces.IFactory>)),
  (('browser:menuItem',
    'zope.app.container.add',
    <InterfaceClass zope.app.container.interfaces.IAdding>,
    'Add an X'),
-  <bound method GlobalBrowserMenuService.menuItem of ''' \
-       '''<zope.app.publisher.browser.globalbrowsermenuservice.''' \
-       '''GlobalBrowserMenuService object>>,
+  <bound method GlobalBrowserMenuService.menuItem of <zope.app.publisher.browser.globalbrowsermenuservice.GlobalBrowserMenuService object>>,
   ('zope.app.container.add',
    <InterfaceClass zope.app.container.interfaces.IAdding>,
    'zope.app.browser.add.X.f1',
@@ -42,7 +47,7 @@
    {'factory': 'zope.app.browser.add.X.f1'})))
 
 $Id$
-'''
+"""
 
 import unittest
 from zope.testing.doctestunit import DocTestSuite
@@ -126,20 +131,25 @@
     ...             permission="zope.ManageContent", description="blah blah",
     ...             filter="context/foo", view="AddX")
     >>> context
-    ((('FactoryFromClass', 'zope.app.browser.add.X.f1'),
-      <function provideClass>,
-      ('zope.app.browser.add.X.f1',
-       <class zope.app.publisher.browser.tests.test_addMenuItem.X>,
-       'zope.ManageContent',
-       '',
-       '')),
+    ((('utility',
+       <InterfaceClass zope.component.interfaces.IFactory>,
+       'zope.app.browser.add.X.f1'),
+      <function checkingHandler>,
+      (Global(CheckerPublic,zope.security.checker),
+       'Utilities',
+       'provideUtility',
+       <InterfaceClass zope.component.interfaces.IFactory>,
+       <zope.component.factory.Factory object>,
+       'zope.app.browser.add.X.f1')),
+     (None,
+      <function provideInterface>,
+      ('zope.component.interfaces.IFactory',
+       <InterfaceClass zope.component.interfaces.IFactory>)),
      (('browser:menuItem',
        'zope.app.container.add',
        <InterfaceClass zope.app.container.interfaces.IAdding>,
        'Add an X'),
-      <bound method GlobalBrowserMenuService.menuItem of """ \
-           """<zope.app.publisher.browser.globalbrowsermenuservice.""" \
-           """GlobalBrowserMenuService object>>,
+      <bound method GlobalBrowserMenuService.menuItem of <zope.app.publisher.browser.globalbrowsermenuservice.GlobalBrowserMenuService object>>,
       ('zope.app.container.add',
        <InterfaceClass zope.app.container.interfaces.IAdding>,
        'AddX',
@@ -148,8 +158,7 @@
        'context/foo',
        'zope.ManageContent',
        {'factory': 'zope.app.browser.add.X.f1'})))
-    """
-    
+"""
 
 
 def test_suite():




More information about the Zope3-Checkins mailing list