Package funkload :: Module FunkLoadTestCase :: Class FunkLoadTestCase
[show private | hide private]
[frames | no frames]

Type FunkLoadTestCase

object --+    
         |    
  TestCase --+
             |
            FunkLoadTestCase

Known Subclasses:
SimpleTest

Unit test with browser and configuration capabilties.
Method Summary
  __init__(self, methodName, options)
Initialise the test case.
  __call__(self, result)
Run the test method.
  addHeader(self, key, value)
Add an http header.
  clearBasicAuth(self)
Remove basic authentication.
  clearContext(self)
Resset the testcase.
  clearHeaders(self)
Remove all http headers set by addHeader or setUserAgent.
  conf_get(self, section, key, default, quiet)
Return an entry from the options or configuration file.
  conf_getFloat(self, section, key, default, quiet)
Return a float from the configuration file.
  conf_getInt(self, section, key, default, quiet)
Return an integer from the configuration file.
  conf_getList(self, section, key, default, quiet, separator)
Return a list from the configuration file.
  delHeader(self, key)
Remove an http header key.
  exists(self, url, params, description)
Try a GET on URL return True if the page exists or False.
  get(self, url, params, description, ok_codes)
GET method on url adding params.
  getBody(self)
Return the last response content.
  getLastBaseUrl(self)
Return the base href url.
  getLastUrl(self)
Return the last accessed url taking into account redirection.
  listHref(self, pattern)
Return a list of href anchor url present in the last html response.
  logd(self, message)
Debug log.
  logdd(self, message)
Verbose Debug log.
  logi(self, message)
Info log.
  post(self, url, params, description, ok_codes)
POST method on url with params.
  setBasicAuth(self, login, password)
Set http basic authentication.
  setHeader(self, key, value)
Add or override an http header.
  setUpCycle(self)
Called on bench mode before a cycle start.
  setUserAgent(self, agent)
Set User-Agent http header for the next requests.
  sleep(self)
Sleeps a random amount of time.
  tearDownCycle(self)
Called after a cycle in bench mode.
  waitUntilAvailable(self, url, time_out, sleep_time)
Wait until url is available.
  xmlrpc(self, url_in, method_name, params, description)
Call an xml rpc method_name on url with params.
  xmlrpc_call(self, url_in, method_name, params, description)
BBB of xmlrpc, this method will be removed for 1.6.0.
    Inherited from TestCase
  __repr__(self)
  __str__(self)
  assert_(self, expr, msg)
Fail the test unless the expression is true.
  assertAlmostEqual(self, first, second, places, msg)
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertAlmostEquals(self, first, second, places, msg)
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertEqual(self, first, second, msg)
Fail if the two objects are unequal as determined by the '==' operator.
  assertEquals(self, first, second, msg)
Fail if the two objects are unequal as determined by the '==' operator.
  assertFalse(self, expr, msg)
Fail the test if the expression is true.
  assertNotAlmostEqual(self, first, second, places, msg)
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertNotAlmostEquals(self, first, second, places, msg)
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertNotEqual(self, first, second, msg)
Fail if the two objects are equal as determined by the '==' operator.
  assertNotEquals(self, first, second, msg)
Fail if the two objects are equal as determined by the '==' operator.
  assertRaises(self, excClass, callableObj, *args, **kwargs)
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs.
  assertTrue(self, expr, msg)
Fail the test unless the expression is true.
  countTestCases(self)
  debug(self)
Run the test without collecting errors in a TestResult
  defaultTestResult(self)
  fail(self, msg)
Fail immediately, with the given message.
  failIf(self, expr, msg)
Fail the test if the expression is true.
  failIfAlmostEqual(self, first, second, places, msg)
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  failIfEqual(self, first, second, msg)
Fail if the two objects are equal as determined by the '==' operator.
  failUnless(self, expr, msg)
Fail the test unless the expression is true.
  failUnlessAlmostEqual(self, first, second, places, msg)
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  failUnlessEqual(self, first, second, msg)
Fail if the two objects are unequal as determined by the '==' operator.
  failUnlessRaises(self, excClass, callableObj, *args, **kwargs)
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs.
  id(self)
  run(self, result)
  setUp(self)
Hook method for setting up the test fixture before exercising it.
  shortDescription(self)
Returns a one-line description of the test, or None if no description has been provided.
  tearDown(self)
Hook method for deconstructing the test fixture after testing it.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Method Details

__init__(self, methodName='runTest', options=None)
(Constructor)

Initialise the test case.

Note that methodName is encoded in bench mode to provide additional information like thread_id, concurrent virtual users...
Overrides:
unittest.TestCase.__init__

__call__(self, result=None)
(Call operator)

Run the test method.

Override to log test result.
Overrides:
unittest.TestCase.__call__

addHeader(self, key, value)

Add an http header.

clearBasicAuth(self)

Remove basic authentication.

clearContext(self)

Resset the testcase.

clearHeaders(self)

Remove all http headers set by addHeader or setUserAgent.

Note that the Referer is also removed.

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

Return an entry from the options or configuration file.

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

Return a float from the configuration file.

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

Return an integer from the configuration file.

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

Return a list from the configuration file.

delHeader(self, key)

Remove an http header key.

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

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

get(self, url, params=None, description=None, ok_codes=None)

GET method on url adding params.

getBody(self)

Return the last response content.

getLastBaseUrl(self)

Return the base href url.

getLastUrl(self)

Return the last accessed url taking into account redirection.

listHref(self, pattern=None)

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

Filtering href using the pattern regex if present.

logd(self, message)

Debug log.

logdd(self, message)

Verbose Debug log.

logi(self, message)

Info log.

post(self, url, params=None, description=None, ok_codes=None)

POST method on url with params.

setBasicAuth(self, login, password)

Set http basic authentication.

setHeader(self, key, value)

Add or override an http header.

If value is None, the key is removed.

setUpCycle(self)

Called on bench mode before a cycle start.

setUserAgent(self, agent)

Set User-Agent http header for the next requests.

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

sleep(self)

Sleeps a random amount of time.

Between the predefined sleep_time_min and sleep_time_max values.

tearDownCycle(self)

Called after a cycle in bench mode.

waitUntilAvailable(self, 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(self, url_in, method_name, params=None, description=None)

Call an xml rpc method_name on url with params.

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

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

Generated by Epydoc 2.1 on Thu Jul 19 15:32:16 2007 http://epydoc.sf.net