Package cubicweb :: Package devtools :: Module testlib
[hide private]
[frames] | no frames]

Module testlib

source code

this module contains base classes and utilities for cubicweb tests
Classes [hide private]
  CubicWebDebugger
special debugger class providing a 'view' function which saves some html into a temporary file and open a web browser to examinate it.
  Email
you'll get instances of Email into MAILBOX during tests that trigger some notification.
  MockSMTP
  TestCaseConnectionProxy
thin wrapper around cubicweb.dbapi.Connection context-manager used in CubicWebTC (cf. cubicweb.devtools.testlib.CubicWebTC.login method)
  CubicWebTC
abstract class for test using an apptest environment
  AutoPopulateTest
base class for test with auto-populating of the database
  AutomaticWebTest
import this if you wan automatic tests to be ran
Functions [hide private]
 
line_context_filter(line_no, center, before=3, after=None)
return true if line are in context
source code
 
unprotected_entities(schema, strict=False)
returned a set of each non final entity type, excluding "system" entities (eg CWGroup, CWUser...)
source code
 
refresh_repo(repo, resetschema=False, resetvreg=False) source code
 
how_many_dict(schema, cursor, how_many, skip)
given a schema, compute how many entities by type we need to be able to satisfy relations cardinality.
source code
 
not_selected(vreg, appobject) source code
 
vreg_instrumentize(testclass) source code
 
print_untested_objects(testclass, skipregs=('hooks','etypes')) source code
Variables [hide private]
  MAILBOX = []
Function Details [hide private]

line_context_filter(line_no, center, before=3, after=None)

source code 

return true if line are in context

if after is None: after = before

how_many_dict(schema, cursor, how_many, skip)

source code 

given a schema, compute how many entities by type we need to be able to satisfy relations cardinality.

The how_many argument tells how many entities of which type we want at least.

Return a dictionary with entity types as key, and the number of entities for this type as value.