[Zope-CVS] CVS: Packages/FunctionalTests/FunctionalTests -
Request.py:1.7.2.3.2.1
Karl Anderson
cvs-admin at zope.org
Thu Nov 13 16:16:57 EST 2003
Update of /cvs-repository/Packages/FunctionalTests/FunctionalTests
In directory cvs.zope.org:/tmp/cvs-serv1065
Modified Files:
Tag: kra-intersest-branch
Request.py
Log Message:
HTTPRequest: added _hook, getHook(), setHook()
_buildHTTPRequest(): set hook from options
=== Packages/FunctionalTests/FunctionalTests/Request.py 1.7.2.3 => 1.7.2.3.2.1 ===
--- Packages/FunctionalTests/FunctionalTests/Request.py:1.7.2.3 Wed Nov 12 14:52:38 2003
+++ Packages/FunctionalTests/FunctionalTests/Request.py Thu Nov 13 16:16:57 2003
@@ -183,6 +183,7 @@
self._expected_redirect = None
self._expected_cookies = ()
self._payload_checker = None
+ self._hook = None
def _initURLParts( self, URL ):
@@ -349,6 +350,13 @@
return ( self._payload_checker and self._payload_checker.getFunction()
or None )
+ def getHook( self ):
+
+ """ See IRequest.
+ """
+ return ( self._hook and self._hook.getFunction()
+ or None )
+
#
# Mutators
#
@@ -414,6 +422,12 @@
"""
self._payload_checker = PluginFunction( filename, function )
+ def setHook( self, filename, function ):
+
+ """ See IHTTPRequest.
+ """
+ self._hook = PluginFunction( filename, function )
+
#
# Request invocation
#
@@ -675,6 +689,11 @@
filename = cp.get( section, 'expected_payload_filename' )
function = cp.get( section, 'expected_payload_function' )
r.setPayloadChecker( filename, function )
+
+ if 'hook_function' in options:
+ filename = cp.get( section, 'hook_filename' )
+ function = cp.get( section, 'hook_function' )
+ r.setHook( filename, function )
r._setOptions( cp, section )
More information about the Zope-CVS
mailing list