Package funkload :: Module PatchWebunit
[hide private]
[frames] | no frames]

Module PatchWebunit

source code

Patching Richard Jones' webunit for FunkLoad.

* Add cache for links (css, js)
* store a browser history
* add headers
* log response
* remove webunit log
* fix HTTPResponse __repr__
* patching webunit mimeEncode to be rfc 1945 3.6.2 compliant using CRLF
* patching to remove cookie with a 'deleted' value
* patching to have application/x-www-form-urlencoded by default and only
  multipart when a file is posted
* patch fetch postdata must be [(key, value) ...] no more dict or list value

$Id: PatchWebunit.py 24649 2005-08-29 14:20:19Z bdelbosc $

Classes [hide private]
  FKLIMGSucker
Image and links loader, patched to log response stats.
Functions [hide private]
 
mimeEncode(data, sep_boundary='----------------GHSKFJDLGDS7543FJKLFHRE75642756743254', end_boundary='----------------GHSKFJDLGDS7543FJKLFHRE75642756743254--')
Take the mapping of data and construct the body of a multipart/form-data message with it using the indicated boundaries.
source code
 
WTC_log(self, message, content)
Remove webunit logging.
source code
 
WTC_pageImages(self, url, page, testcase=None)
Given the HTML page that was loaded from url, grab all the images.
source code
 
WF_fetch(self, url, postdata=None, server=None, port=None, protocol=None, ok_codes=None, key_file=None, cert_file=None)
Run a single test request to the indicated url.
source code
 
HR___repr__(self)
fix HTTPResponse rendering.
source code
Variables [hide private]
  valid_url = re.compile(r'(?i)^(http|s)://[a-z0-9\.-:]+(/[^ \t<...
  BOUNDARY = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
  SEP_BOUNDARY = '----------------GHSKFJDLGDS7543FJKLFHRE7564275...
  END_BOUNDARY = '----------------GHSKFJDLGDS7543FJKLFHRE7564275...
Function Details [hide private]

WF_fetch(self, url, postdata=None, server=None, port=None, protocol=None, ok_codes=None, key_file=None, cert_file=None)

source code 

Run a single test request to the indicated url. Use the POST data if supplied. Accepts key and certificate file paths for https (ssl/tls) connections.

Raises failureException if the returned data contains any of the strings indicated to be Error Content. Returns a HTTPReponse object wrapping the response from the server.


Variables Details [hide private]

valid_url

Value:
re.compile(r'(?i)^(http|s)://[a-z0-9\.-:]+(/[^ \t<>]*)?$')

SEP_BOUNDARY

Value:
'----------------GHSKFJDLGDS7543FJKLFHRE75642756743254'

END_BOUNDARY

Value:
'----------------GHSKFJDLGDS7543FJKLFHRE75642756743254--'