Table of Contents

Module: base qm/test/base.py
Functions   
_result_from_dom
get_extension_class
get_extension_class_from_directory
get_extension_class_names
get_extension_class_names_in_directory
get_extension_directories
get_resource_class
get_test_class
load_outcomes
load_results
  _result_from_dom 
_result_from_dom ( node )

Extract a result from a DOM node.

node
A DOM node corresponding to a "result" element.
returns
A Result object. The context for the result is None, since context is not represented in a result DOM node.
  get_extension_class 
get_extension_class (
        class_name,
        kind,
        database,
        database_path=None,
        )

Return the extension class named class_name.

class_name
The name of the class, in the form module.class.
kind
The kind of class to load. This value must be one of the extension_kinds.
database
The Database with which the extension class will be used, or None if kind is database.
database_path
The path from which the database will be loaded. If None, database.GetPath() is used.
returns
The class object with the indicated class_name.
Exceptions   
QMException, qm.error( "extension class not found", klass = class_name )
  get_extension_class_from_directory 
get_extension_class_from_directory (
        class_name,
        kind,
        directory,
        path,
        )

Load an extension class from directory.

class_name
The name of the extension class, in the form module.class.
kind
The kind of class to load. This value must be one of the extension_kinds.
directory
The directory from which to load the class.
path
The directories to search for modules imported by the new module.
returns
The class loaded.
Exceptions   
CouldNotLoadExtensionError(class_name, sys.exc_info() )
QMException, qm.error( "extension class not subclass", kind = kind, class_name = class_name, base_name = __extension_bases [ kind ].__name__ )
  get_extension_class_names 
get_extension_class_names (
        kind,
        database,
        database_path=None,
        )

Return the names of extension classes.

kind
The kind of extension class. This value must be one of the extension_kinds.
database
The Database with which the extension class will be used, or None if kind is database.
database_path
The path from which the database will be loaded. If None, database.GetPath() is used.
returns
A sequence of strings giving the names of the extension classes with the indicated kind, in the form module.class.
  get_extension_class_names_in_directory 
get_extension_class_names_in_directory ( directory )

Return the names of QMTest extension classes in directory.

directory
A string giving the path to a directory in the file system.
returns
A dictionary mapping the strings in extension_kinds to sequences of strings. Each element in the sequence names an extension class, using the form module.class
  get_extension_directories 
get_extension_directories (
        kind,
        database,
        database_path=None,
        )

Return the directories to search for QMTest extensions.

kind
A string giving kind of extension for which we are looking. This must be of the elements of extension_kinds.
database
The Database with which the extension class will be used, or None.
database_path
The path from which the database will be loaded. If None, database.GetPath() is used.
returns
A sequence of strings. Each string is the path to a directory that should be searched for QMTest extensions. The directories must be searched in order; the first directory containing the desired module is the one from which the module is loaded.

The directories that are returned are, in order:

  1. Those directories present in the QMTEST_CLASS_PATH environment variable.

  2. Those directories specified by the GetClassPaths method on the test database -- unless kind is database.

  3. The directories containing classes that come with QMTest.

By placing the QMTEST_CLASS_PATH directories first, users can override test classes with standard names.

  get_resource_class 
get_resource_class ( class_name,  database )

Return the resource class named class_name.

class_name
The name of the resource class, in the form module.class.
returns
The resource class object with the indicated class_name.
  get_test_class 
get_test_class ( class_name,  database )

Return the test class named class_name.

class_name
The name of the test class, in the form module.class.
returns
The test class object with the indicated class_name.
  load_outcomes 
load_outcomes ( file,  database )

Load test outcomes from a file.

file
The file object from which to read the results.
database
The current database.
returns
A map from test IDs to outcomes.
  load_results 
load_results ( file,  database )

Read test results from a file.

file
The file object from which to read the results.
database
The current database.
returns
A ResultReader object.
Classes   

CouldNotLoadExtensionError

An exception indicating that an extension class could not be loaded.


Table of Contents

This document was automatically generated on Mon Jan 3 09:42:29 2005 by HappyDoc version 2.1