Package csb :: Package test :: Class AbstractTestBuilder
[frames] | no frames]

Class AbstractTestBuilder

source code

object --+
         |
        AbstractTestBuilder
Known Subclasses:

This is a base class, defining a test loader which exposes the loadTests method.

Subclasses must override the labels abstract property, which controls what kind of test cases are loaded by the test builder.

Nested Classes
  __metaclass__
Metaclass for defining Abstract Base Classes (ABCs).
Instance Methods
unittest.TestSuite
loadAllTests(self, namespace, extension='.py')
Load csb.test.Cases recursively from the given CSB namespace and all of its sub-packages.
source code
unittest.TestSuite
loadFromFile(self, file)
Load csb.test.Cases from a module file.
source code
unittest.TestSuite
loadMultipleTests(self, namespaces)
Load csb.test.Cases from a list of given CSB namespaces.
source code
unittest.TestSuite
loadTests(self, namespace)
Load csb.test.Cases from the given CSB namespace.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  __abstractmethods__ = frozenset(['labels'])
Properties
  labels

Inherited from object: __class__

Method Details

loadAllTests(self, namespace, extension='.py')

source code 

Load csb.test.Cases recursively from the given CSB namespace and all of its sub-packages. Same as:

   builder.loadTests('namespace.*')
Parameters:
  • namespace (str) - test module namespace, e.g. 'csb.test.cases.bio' will load tests from /csb/test/cases/bio/*'
Returns: unittest.TestSuite
a unittest.TestSuite ready for the test runner

loadFromFile(self, file)

source code 

Load csb.test.Cases from a module file.

Parameters:
  • file (str) - test module file name
Returns: unittest.TestSuite
a unittest.TestSuite ready for the test runner

loadMultipleTests(self, namespaces)

source code 

Load csb.test.Cases from a list of given CSB namespaces.

Parameters:
  • namespaces (tuple of str) - a list of test module namespaces, e.g. ('csb.test.cases.bio', 'csb.test.cases.bio.io') will load tests from '/csb/test/cases/bio.py' and '/csb/test/cases/bio/io.py'
Returns: unittest.TestSuite
a unittest.TestSuite ready for the test runner

loadTests(self, namespace)

source code 

Load csb.test.Cases from the given CSB namespace. If the namespace ends with a wildcard, tests from sub-packages will be loaded as well. If the namespace is '__main__' or '.', tests are loaded from __main__.

Parameters:
  • namespace (str) - test module namespace, e.g. 'csb.test.cases.bio' will load tests from '/csb/test/cases/bio/__init__.py'
Returns: unittest.TestSuite
a unittest.TestSuite ready for the test runner

Property Details

labels

Get Method:
unreachable.labels(self)