[Zope-Checkins] CVS: Zope2 - makerequest.py:1.3
Martijn Pieters
mj@digicool.com
Wed, 18 Apr 2001 19:02:05 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/Testing
In directory korak:/tmp/cvs-serv16094
Modified Files:
makerequest.py
Log Message:
Allow a testcase to redirect the stdout of the created HTTPResponse to an
object of its choosing, so we can retrieve the output of RESPONSE.write().
--- Updated File makerequest.py in package Zope2 --
--- makerequest.py 2001/03/15 13:16:25 1.2
+++ makerequest.py 2001/04/18 23:02:04 1.3
@@ -97,13 +97,13 @@
import os
from os import environ
-from sys import stdin
+from sys import stdin, stdout
from ZPublisher.HTTPRequest import HTTPRequest
from ZPublisher.HTTPResponse import HTTPResponse
from ZPublisher.BaseRequest import RequestContainer
-def makerequest(app):
- resp = HTTPResponse()
+def makerequest(app, stdout=stdout):
+ resp = HTTPResponse(stdout=stdout)
environ['SERVER_NAME']='foo'
environ['SERVER_PORT']='80'
environ['REQUEST_METHOD'] = 'GET'