Table Of Contents

This Page

Test Modules

funkload.FunkLoadTestCase – FunkLoadTestCase

FunkLoad test case using Richard Jones’ webunit.

$Id: 24757 2005-08-31 12:22:19Z bdelbosc $

class funkload.FunkLoadTestCase.DummyTestCase(methodName='runTest', options=None)

Testing Funkload TestCase.


Simple apache test.

class funkload.FunkLoadTestCase.FunkLoadTestCase(methodName='runTest', options=None)

Unit test with browser and configuration capabilties.

addHeader(key, value)

Add an http header.

addMetadata(ns='meta', **kw)

Add metadata info.


Remove basic authentication.


Reset the testcase.


Remove all http headers set by addHeader or setUserAgent.

Note that the Referer is also removed.


Clear any key file or certificate file paths set by calls to setKeyAndCertificateFile.

comet(url, consumer, description=None)

Initiate a comet request and process the input in a separate thread. This call is async and return a thread object.

The consumer method takes as parameter an input string, it can close the comet connection by returning 0.

conf_get(section, key, default=, []quiet=False)

Return an entry from the options or configuration file.

conf_getFloat(section, key, default=, []quiet=False)

Return a float from the configuration file.

conf_getInt(section, key, default=, []quiet=False)

Return an integer from the configuration file.

conf_getList(section, key, default=, []quiet=False, separator=None)

Return a list from the configuration file.


Print request headers.


Remove an http header key.

delete(url, description=None, ok_codes=None)

DELETE method on url.

exists(url, params=None, description='Checking existence')

Try a GET on URL return True if the page exists or False.

get(url, params=None, description=None, ok_codes=None, load_auto_links=True)

GET method on url adding params.


Return the last response content.


Return the base href url.


Return the last accessed url taking into account redirection.

head(url, description=None, ok_codes=None)

HEAD method on url adding params.

listHref(url_pattern=None, content_pattern=None)

Return a list of href anchor url present in the last html response.

Filtering href with url pattern or link text pattern.


Debug log.


Verbose Debug log.


Info log.

method(method, url, params=None, description=None, ok_codes=None, load_auto_links=True)

Generic method request can be used to submit MOVE, MKCOL or whatever method name request.

midCycle(cycle, cvus)

Called in the middle of a bench cycle.

options(url, description=None, ok_codes=None)

OPTIONS method on url.

post(url, params=None, description=None, ok_codes=None, load_auto_links=True)

POST method on url with params.

propfind(url, params=None, depth=None, description=None, ok_codes=None)


put(url, params=None, description=None, ok_codes=None, load_auto_links=True)

PUT method.

setBasicAuth(login, password)

Set HTTP basic authentication for the following requests.

setHeader(key, value)

Add or override an http header.

If value is None, the key is removed.

setKeyAndCertificateFile(keyfile_path, certfile_path)

Set the paths to a key file and a certificate file that will be used by a https (ssl/tls) connection when calling the post or get methods.

keyfile_path : path to a PEM formatted file that contains your private key. certfile_path : path to a PEM formatted certificate chain file.


Set ok codes.


Called before the start of the bench.


Called on bench mode before a cycle start.


Set User-Agent http header for the next requests.

If agent is None, the user agent header is removed.


Sleeps a random amount of time.

Between the predefined sleep_time_min and sleep_time_max values.


Called after a the bench.


Called after a cycle in bench mode.

waitUntilAvailable(url, time_out=20, sleep_time=2)

Wait until url is available.

Try a get on url every sleep_time until server is reached or time is out.

xmlrpc(url_in, method_name, params=None, description=None)

Call an xml rpc method_name on url with params.

xmlrpc_call(url_in, method_name, params=None, description=None)

BBB of xmlrpc, this method will be removed for 1.6.0.

funkload.FunkLoadTestCase.random() → x in the interval [0, 1).

funkload.FunkLoadDocTest – FunkLoadDocTest

FunkLoad doc test


class funkload.FunkLoadDocTest.FunkLoadDocTest(debug=False, debug_level=1)

Class to use in doctest.

>>> from FunkLoadDocTest import FunkLoadDocTest
>>> fl = FunkLoadDocTest()
>>> ret = fl.get('http://localhost')
>>> ret.code
>>> 'HTML' in ret.body

FL doctest