Package qm :: Package test :: Module parameter_database :: Class ParameterDatabase
[show private | hide private]
[frames | no frames]

Type ParameterDatabase

object --+        
         |        
 Extension --+    
             |    
      Database --+
                 |
                ParameterDatabase


A database that parametrizes another database. 'Parameter' in this context refers to any name that is used as a label, and which stands for a specific set of arguments passed to tests.

The 'ParameterDatabase' class is abstract. Subclasses need to implement the '_GetParametersForTest' as well as the '_GetArgumentsForParameter' method.
Method Summary
  __init__(self, database, path, arguments)
  GetAttachmentStore(self)
Returns the 'AttachmentStore' associated with the database.
  GetClassPath(self)
  GetIds(self, kind, directory, scan_subdirs)
Return all IDs of the indicated 'kind' that begin with 'directory'.
  GetResource(self, resource_id)
Return the 'ResourceDescriptor' for the resource 'resouce_id'.
  GetResourceClassNames(self)
Return the kinds of resources that the database can store.
  GetResourceIds(self, directory, scan_subdirs)
Return all resource IDs that begin with 'directory'.
  GetSubdirectories(self, directory)
Return the immediate subdirectories of 'directory'.
  GetSuite(self, suite_id)
Return the 'Suite' for the suite named 'suite_id'.
  GetSuiteIds(self, directory, scan_subdirs)
Return all suite IDs that begin with 'directory'.
  GetTest(self, test_id)
Return the 'TestDescriptor' for the test named 'test_id'.
  GetTestClassNames(self)
Return the kinds of tests that the database can store.
  GetTestIds(self, directory, scan_subdirs)
Return all test IDs that begin with 'directory'.
  GetWrappedDatabase(self)
  HasResource(self, resource_id)
Check whether or not the database has a resource named 'resource_id'.
  HasSuite(self, suite_id)
Check whether or not the database has a suite named 'suite_id'.
  HasTest(self, test_id)
Check whether or not the database has a test named 'test_id'.
    Inherited from Database
  ExpandIds(self, ids)
Expand test and suite IDs into test IDs.
  GetClassPaths(self)
Return directories to search for test and resource classes.
  GetConfigurationDirectory(self)
Return the directory containing configuration information.
  GetExtension(self, id)
Return the extension object named 'id'.
  GetExtensions(self, directory, scan_subdirs)
Return the extensions in 'directory'.
  GetItem(self, kind, item_id)
Return the item of the indicated 'kind' with indicated 'item_id'.
  GetLabelComponents(self, label)
Return all of the component directories of 'label'.
  GetPath(self)
Return the directory containing the database.
  IsModifiable(self)
Returns true iff this database is modifiable.
  IsValidLabel(self, label, is_component)
Return true if 'label' is valid.
  JoinLabels(self, *labels)
Join the 'labels' together.
  RemoveExtension(self, id, kind)
Remove the extension 'id' from the database.
  SplitLabel(self, label)
Split the label into a pair '(directory, basename)'.
  SplitLabelLeft(self, label)
Split the label into a pair '(parent, subpath)'.
  WriteExtension(self, id, extension)
Store 'extension' in the database, using the name 'id'.
    Inherited from Extension
  __getattr__(self, name)
  GetClassName(self)
Return the name of the extension class.
  GetExplicitArguments(self)
Return the arguments to this extension instance.
  MakeDomDocument(self)
Create a DOM document for 'self'.
  MakeDomElement(self, document, element)
Create a DOM node for 'self'.
  Write(self, file)
Write an XML description of 'self' to a file.
    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
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
Type ImplicitSuite = qm.test.parameter_database.ImplicitSuite
str label_class = 'python_label.PythonLabel'
str modifiable = 'true'
Type ParameterSuite = qm.test.parameter_database.ParameterSuite
Type WrapperSuite = qm.test.parameter_database.WrapperSuite
    Inherited from Database
list arguments = [<<class 'qm.fields.TextField'> label_class>...
list ITEM_KINDS = ['resource', 'suite', 'test']
str kind = 'database'
str RESOURCE = 'resource'
str SUITE = 'suite'
str TEST = 'test'

Method Details

GetAttachmentStore(self)

Returns the 'AttachmentStore' associated with the database.

returns -- The 'AttachmentStore' containing the attachments associated with tests and resources in this database.

Derived classes may override this method.
Overrides:
qm.test.database.Database.GetAttachmentStore (inherited documentation)

GetIds(self, kind, directory='', scan_subdirs=1)

Return all IDs of the indicated 'kind' that begin with 'directory'.

'kind' -- One of the 'ITEM_KINDS'.

'directory' -- A label indicating the directory in which to begin the search.

'scan_subdirs' -- True if (and only if) subdirectories of 'directory' should be scanned.

returns -- A list of all items of the indicated 'kind' located within 'directory', as absolute labels.

Derived classes may override this method.
Overrides:
qm.test.database.Database.GetIds (inherited documentation)

GetResource(self, resource_id)

Return the 'ResourceDescriptor' for the resource 'resouce_id'.

'resource_id' -- A label naming the resource.

returns -- A 'ResourceDescriptor' corresponding to 'resource_id'.

raises -- 'NoSuchResourceError' if there is no resource in the database named 'resource_id'.
Overrides:
qm.test.database.Database.GetResource (inherited documentation)

GetResourceClassNames(self)

Return the kinds of resources that the database can store.

returns -- A sequence of strings. Each string names a class, including the containing module. Only resources of these types can be stored in the database.

Derived classes may override this method. The default implementation allows all available resource classes, but the derived class may allow only a subset.
Overrides:
qm.test.database.Database.GetResourceClassNames (inherited documentation)

GetResourceIds(self, directory='', scan_subdirs=1)

Return all resource IDs that begin with 'directory'.

'directory' -- A label indicating the directory in which to begin the search.

'scan_subdirs' -- True if (and only if) subdirectories of 'directory' should be scanned.

'returns' -- A list of all resources located within 'directory', as absolute labels.
Overrides:
qm.test.database.Database.GetResourceIds (inherited documentation)

GetSubdirectories(self, directory)

Return the immediate subdirectories of 'directory'.

'directory' -- A label indicating a directory in the database.

returns -- A sequence of (relative) labels indictating the immediate subdirectories of 'directory'. For example, if "a.b" and "a.c" are directories in the database, this method will return "b" and "c" given "a" as 'directory'.

Derived classes may override this method.
Overrides:
qm.test.database.Database.GetSubdirectories (inherited documentation)

GetSuite(self, suite_id)

Return the 'Suite' for the suite named 'suite_id'.

'suite_id' -- A label naming the suite.

returns -- An instance of 'Suite' (or a derived class of 'Suite') corresponding to 'suite_id'.

raises -- 'NoSuchSuiteError' if there is no test in the database named 'test_id'.

All databases must have an implicit suite called '' that contains all tests in the database. More generally, for each directory in the database, there must be a corresponding suite that contains all tests in that directory and its subdirectories.
Overrides:
qm.test.database.Database.GetSuite (inherited documentation)

GetSuiteIds(self, directory='', scan_subdirs=1)

Return all suite IDs that begin with 'directory'.

'directory' -- A label indicating the directory in which to begin the search.

'scan_subdirs' -- True if (and only if) subdirectories of 'directory' should be scanned.

'returns' -- A list of all suites located within 'directory', as absolute labels.
Overrides:
qm.test.database.Database.GetSuiteIds (inherited documentation)

GetTest(self, test_id)

Return the 'TestDescriptor' for the test named 'test_id'.

'test_id' -- A label naming the test.

returns -- A 'TestDescriptor' corresponding to 'test_id'.

raises -- 'NoSuchTestError' if there is no test in the database named 'test_id'.
Overrides:
qm.test.database.Database.GetTest (inherited documentation)

GetTestClassNames(self)

Return the kinds of tests that the database can store.

returns -- A sequence of strings. Each string names a class, including the containing module. Only classes of these types can be stored in the database.

Derived classes may override this method. The default implementation allows all available test classes, but the derived class may allow only a subset.
Overrides:
qm.test.database.Database.GetTestClassNames (inherited documentation)

GetTestIds(self, directory='', scan_subdirs=1)

Return all test IDs that begin with 'directory'.

'directory' -- A label indicating the directory in which to begin the search.

'scan_subdirs' -- True if (and only if) subdirectories of 'directory' should be scanned.

'returns' -- A list of all tests located within 'directory', as absolute labels.
Overrides:
qm.test.database.Database.GetTestIds (inherited documentation)

HasResource(self, resource_id)

Check whether or not the database has a resource named 'resource_id'.

'resource_id' -- A label naming the resource.

returns -- True if and only if the database contains a resource named 'resource_id'. If this function returns true, 'GetResource' will usually succeed. However, they may be circumstances where 'HasResource' returns true and 'GetResource' does not succeed. For example, someone might remove a critical file from the database between the time that 'HasResource' is called and the time that 'GetResource' is called.

Derived classes may override this method.
Overrides:
qm.test.database.Database.HasResource (inherited documentation)

HasSuite(self, suite_id)

Check whether or not the database has a suite named 'suite_id'.

'suite_id' -- A label naming the suite.

returns -- True if and only if the database contains a suite named 'suite_id'. If this function returns true, 'GetSuite' will usually succeed. However, they may be circumstances where 'HasSuite' returns true and 'GetSuite' does not succeed. For example, someone might remove a critical file from the database between the time that 'HasSuite' is called and the time that 'GetSuite' is called.

All databases must have an implicit suite called "" that contains all tests in the database. More generally, for each directory in the database, there must be a corresponding suite that contains all tests in that directory and its subdirectories.

Derived classes may override this method.
Overrides:
qm.test.database.Database.HasSuite (inherited documentation)

HasTest(self, test_id)

Check whether or not the database has a test named 'test_id'.

'test_id' -- A label naming the test.

returns -- True if and only if the database contains a test named 'test_id'. If this function returns true, 'GetTest' will usually succeed. However, they may be circumstances where 'HasTest' returns true and 'GetTest' does not succeed. For example, someone might remove a critical file from the database between the time that 'HasTest' is called and the time that 'GetTest' is called.

Derived classes may override this method.
Overrides:
qm.test.database.Database.HasTest (inherited documentation)

Class Variable Details

label_class

Type:
str
Value:
'python_label.PythonLabel'                                             

modifiable

Type:
str
Value:
'true'                                                                 

Generated by Epydoc 2.1 on Thu Sep 27 15:48:58 2007 http://epydoc.sf.net