Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 855

Show
Ignore:
Timestamp:
12/02/05 11:56:47
Author:
fumanchu
Message:

Implemented Titus Brown's patch for using twill with webtest.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/webtest.py

    r768 r855  
    138138 
    139139class WebCase(TestCase): 
    140      
    141140    HOST = "127.0.0.1" 
    142141    PORT = 8000 
     142    HTTP_CONN=httplib.HTTPConnection 
    143143     
    144144    def getPage(self, url, headers=None, method="GET", body=None): 
     
    147147         
    148148        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) 
    150151        self.status, self.headers, self.body = result 
    151152         
     
    337338 
    338339def 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): 
    340341    """Open the given HTTP resource and return status, headers, and body.""" 
    341342     
     
    347348    while trial < 10: 
    348349        try: 
    349             conn = httplib.HTTPConnection(host, port) 
     350            conn = http_conn(host, port) 
    350351            conn.putrequest(method.upper(), url) 
    351352             

Hosted by WebFaction

Log in as guest/cpguest to create tickets