[Zope3-checkins] CVS: Zope3/src/zope/app/tests - ztapi.py:1.3

Philipp von Weitershausen cvs-admin at zope.org
Fri Dec 5 07:41:39 EST 2003


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

Modified Files:
	ztapi.py 
Log Message:
Add provideUtility to the ztapi module for test convenience.


=== Zope3/src/zope/app/tests/ztapi.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/tests/ztapi.py:1.2	Fri Nov 21 12:09:37 2003
+++ Zope3/src/zope/app/tests/ztapi.py	Fri Dec  5 07:41:38 2003
@@ -17,7 +17,7 @@
 """
 from zope.app import zapi
 import zope.interface
-from zope.component.servicenames import Presentation, Adapters
+from zope.component.servicenames import Presentation, Adapters, Utilities
 from zope.publisher.browser import IBrowserRequest
 
 def browserView(for_, name, factory, layer='default'):
@@ -31,7 +31,6 @@
     """
     s = zapi.getService(None, Presentation)
     return s.provideResource(name, IBrowserRequest, factory, layer)
-    
 
 def setDefaultViewName(for_, name, layer='default'):
     s = zapi.getService(None, Presentation)
@@ -44,3 +43,6 @@
         factory = [factory]
     s.provideAdapter(required, provided, factory, name, with)
     
+def provideUtility(provided, component, name=''):
+    s = zapi.getService(None, Utilities)
+    s.provideUtility(provided, component, name)




More information about the Zope3-Checkins mailing list