[Zope3-checkins] CVS: Zope3/src/zope/app/site/browser/tests - test_directives.py:1.2

Stephan Richter srichter at cosmos.phy.tufts.edu
Sun Mar 21 19:52:28 EST 2004


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

Modified Files:
	test_directives.py 
Log Message:


Added tests for servicetool directive.


=== Zope3/src/zope/app/site/browser/tests/test_directives.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/site/browser/tests/test_directives.py:1.1	Sun Mar 21 11:02:26 2004
+++ Zope3/src/zope/app/site/browser/tests/test_directives.py	Sun Mar 21 19:52:28 2004
@@ -22,7 +22,9 @@
 from zope.app.tests.placelesssetup import setUp, tearDown
 
 class FauxContext:
-    actions = []
+    def __init__(self):
+        self.actions = []
+
     def action(self, **kw):
         self.actions.append(kw)
 
@@ -57,9 +59,38 @@
     'zope.app.component.metaconfigure'
     >>> view['args'][5]
     'manageIDummyUtilityTool.html'
-    
     """
 
+
+def _test_servicetoolDirective():
+    r"""
+    >>> from zope.app.site.browser import metaconfigure
+    >>> context = FauxContext()
+    >>> metaconfigure.servicetool(context, folder="dummy",
+    ...                    title="dummy", description="the description")
+
+    >>> iface = context.actions[0]
+    >>> iface['discriminator']
+    >>> iface['callable'].__module__
+    'zope.app.component.interface'
+    >>> iface['args'][1].getName()
+    'ILocalService'
+    >>> iface['args'][2].getName()
+    'IToolType'
+
+    >>> view = context.actions[1]
+    >>> print '\n'.join([str(n) for n in view['discriminator']])
+    view
+    (<InterfaceClass zope.app.site.interfaces.ISiteManager>,)
+    manageILocalServiceTool.html
+    <InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest>
+    default
+    <InterfaceClass zope.interface.Interface>
+    >>> view['callable'].__module__
+    'zope.app.component.metaconfigure'
+    >>> view['args'][5]
+    'manageILocalServiceTool.html'
+    """
 
 def test_suite():
     return unittest.TestSuite((




More information about the Zope3-Checkins mailing list