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

Type CPSTestCase

  object --+            
           |            
    TestCase --+        
               |        
FunkLoadTestCase --+    
                   |    
        ZopeTestCase --+
                       |
                      CPSTestCase

Known Subclasses:
CPSDocTest

Common CPS tasks.

setUp must set a server_url attribute.
Method Summary
  cpsChangeUiLanguage(self, lang)
Change the ui language and return the referer page.
  cpsCleanUrl(self, url_in)
Try to remove server_url and clean ending.
  cpsCreateDocument(self, parent_url)
Create a simple random document.
  cpsCreateFolder(self, type, parent_url, title, description, lang)
Create a section or a workspace.
  cpsCreateGroup(self, group_name)
Create a cps group.
  cpsCreateNewsItem(self, parent_url, photo_path)
Create a random news.
  cpsCreateSection(self, parent_url, title, description, lang)
Create a section.
  cpsCreateSite(self, admin_id, admin_pwd, manager_id, manager_password, manager_mail, langs, title, description, interface, zope_url, site_id, extensions)
Create a CPS Site.
  cpsCreateUser(self, user_id, user_pwd, user_givenName, user_sn, user_email, groups)
Create a cps user with the Member role.
  cpsCreateWorkspace(self, parent_url, title, description, lang)
Create a workspace.
  cpsGetRandomLanguage(self)
Return a random language.
  cpsGuessZopeUrl(self, cps_url)
Guess a zope url and site_id from a CPS Site url.
  cpsListDocumentHref(self, pattern)
Return a clean list of document href that matches pattern.
  cpsLogin(self, login, password, comment)
Log in a user.
  cpsLogout(self)
Log out the current user.
  cpsSearchDocId(self, doc_id)
Return the list of url that ends with doc_id.
  cpsSetLocalRole(self, url, name, role)
Setup local role role to url.
  cpsVerifyGroup(self, group_name)
Check existance or create a cps group.
  cpsVerifyUser(self, user_id, user_pwd, user_givenName, user_sn, user_email, groups)
Verify if user exists or create him.
    Inherited from ZopeTestCase
  zopeAddExternalMethod(self, parent_url, admin_id, admin_pwd, method_id, module, function, run_it)
Add an External method an run it.
  zopeFlushCache(self, zope_url, admin_id, admin_pwd, database)
Remove all objects from all ZODB in-memory caches.
  zopePackZodb(self, zope_url, admin_id, admin_pwd, database, days)
Pack a zodb database.
  zopeRestart(self, zope_url, admin_id, admin_pwd, time_out)
Stop and Start Zope server.
    Inherited from FunkLoadTestCase
  __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

Class Variable Summary
tuple cps_test_case_version = (3, 4, 0)
NoneType server_url = None                                                                  

Method Details

cpsChangeUiLanguage(self, lang)

Change the ui language and return the referer page.

cpsCleanUrl(self, url_in)

Try to remove server_url and clean ending.

cpsCreateDocument(self, parent_url)

Create a simple random document.

return a tuple: (doc_url, doc_id)

cpsCreateFolder(self, type, parent_url, title, description, lang)

Create a section or a workspace.

Return the section full url.

cpsCreateGroup(self, group_name)

Create a cps group.

cpsCreateNewsItem(self, parent_url, photo_path=None)

Create a random news.

return a tuple: (doc_url, doc_id).

cpsCreateSection(self, parent_url, title, description='ftest section for funkload testing.', lang=None)

Create a section.

cpsCreateSite(self, admin_id, admin_pwd, manager_id, manager_password, manager_mail, langs=None, title=None, description=None, interface='portlets', zope_url=None, site_id=None, extensions=None)

Create a CPS Site.

if zope_url or site_id is not provided guess them from the server_url.

cpsCreateUser(self, user_id=None, user_pwd=None, user_givenName=None, user_sn=None, user_email=None, groups=None)

Create a cps user with the Member role.

return login, pwd

cpsCreateWorkspace(self, parent_url, title, description='ftest workspace for funkload testing.', lang=None)

Create a workspace.

cpsGetRandomLanguage(self)

Return a random language.

cpsGuessZopeUrl(self, cps_url=None)

Guess a zope url and site_id from a CPS Site url.

return a tuple (zope_url, site_id)

cpsListDocumentHref(self, pattern=None)

Return a clean list of document href that matches pattern.

Try to remove server_url and other cps trailings, return a list of uniq url.

cpsLogin(self, login, password, comment=None)

Log in a user.

Raise on invalid credential.

cpsLogout(self)

Log out the current user.

cpsSearchDocId(self, doc_id)

Return the list of url that ends with doc_id.

Using catalog search.

cpsSetLocalRole(self, url, name, role)

Setup local role role to url.

cpsVerifyGroup(self, group_name)

Check existance or create a cps group.

cpsVerifyUser(self, user_id=None, user_pwd=None, user_givenName=None, user_sn=None, user_email=None, groups=None)

Verify if user exists or create him.

return login, pwd

if user exists pwd is None.

Class Variable Details

cps_test_case_version

Type:
tuple
Value:
(3, 4, 0)                                                              

server_url

Type:
NoneType
Value:
None                                                                  

Generated by Epydoc 2.1 on Tue Feb 27 10:41:43 2007 http://epydoc.sf.net