Changeset 855
- Timestamp:
- 12/02/05 11:56:47
- Files:
-
- trunk/cherrypy/test/webtest.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/test/webtest.py
r768 r855 138 138 139 139 class WebCase(TestCase): 140 141 140 HOST = "127.0.0.1" 142 141 PORT = 8000 142 HTTP_CONN=httplib.HTTPConnection 143 143 144 144 def getPage(self, url, headers=None, method="GET", body=None): … … 147 147 148 148 self.url = url 149 result = openURL(url, headers, method, body, self.HOST, self.PORT) 149 result = openURL(url, headers, method, body, self.HOST, self.PORT, 150 self.HTTP_CONN) 150 151 self.status, self.headers, self.body = result 151 152 … … 337 338 338 339 def openURL(url, headers=None, method="GET", body=None, 339 host="127.0.0.1", port=8000 ):340 host="127.0.0.1", port=8000, http_conn=httplib.HTTPConnection): 340 341 """Open the given HTTP resource and return status, headers, and body.""" 341 342 … … 347 348 while trial < 10: 348 349 try: 349 conn = http lib.HTTPConnection(host, port)350 conn = http_conn(host, port) 350 351 conn.putrequest(method.upper(), url) 351 352

