Package qm :: Package test :: Module run_database :: Class RunDatabase
[hide private]
[frames] | no frames]

Class RunDatabase
source code

         object --+    
                  |    
extension.Extension --+
                      |
                     RunDatabase
Known Subclasses:
classes.dir_run_database.DirRunDatabase

A 'RunDatabase' stores 'TestRun's.

A 'RunDatabase' provides a mechanism for selecting 'TestRun's that meet particular criteria.

Nested Classes [hide private]

Inherited from extension.Extension: Type, __metaclass__


Instance Methods [hide private]
  GetAllRuns(self)
Return all the 'TestRun's in the database.
  GetAnnotations(self, key)
Return the set of annotations for 'key' from all test runs.
  GetOutcomes(self, id, kind=Result.TEST)
Return an outcome dictionary for the indicated test.
  GetRunInTimeframe(self, key, value, time_key, minimum, maximum, is_iso_time=True)
Return a test run id matching the key and timeframe.
  GetRuns(self, predicate)
Return the set of 'TestRun's satisfying 'predicate'
  GetRunsByAnnotations(self, annotation_filter)
Return the 'TestRun's matching 'annotation_filter'.
  GetTimeframe(self, time_key, is_iso_time=True)
Return a pair of min / max values found for the given time_key across all test runs.

Inherited from extension.Extension: GetClassName, GetExplicitArguments, MakeDomDocument, MakeDomElement, Write, __getattr__, __init__

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Class Variables [hide private]

Inherited from extension.Extension: arguments, kind

Inherited from object: __class__


Method Details [hide private]

GetAllRuns(self)

source code 

Return all the 'TestRun's in the database.

returns -- A sequence consisting of all of the 'TestRun's in the database.

GetAnnotations(self, key)

source code 

Return the set of annotations for 'key' from all test runs.

'key' -- A string used to look up the annotations.

returns -- A set of (distinct) annotations for 'key' from all test runs.

GetOutcomes(self, id, kind=Result.TEST)

source code 

Return an outcome dictionary for the indicated test.

'id' -- The name of a test, suite, or resource item.

'kind' -- The kind of the item to retrieve the outcome for.

returns -- A dictionary indicating the number of outcomes per category.

GetRunInTimeframe(self, key, value, time_key, minimum, maximum, is_iso_time=True)

source code 
Return a test run id matching the key and timeframe.

GetRuns(self, predicate)

source code 

Return the set of 'TestRun's satisfying 'predicate'

'predicate' -- A callable that can be passed one 'TestRun' argument.

returns -- A sequence of 'TestRun's consisting only of those 'TestRun's in the database for which 'predicate' returns a true value.

GetRunsByAnnotations(self, annotation_filter)

source code 

Return the 'TestRun's matching 'annotation_filter'.

'annotation_filter' -- A dictionary mapping annotation keys (strings) to values (either strings or callables).

returns -- A sequence of 'TestRun's consisting only of those 'TestRun's in the database that match the 'annotation_filter'. A 'TestRun' matches the 'annotation_filter' if it matches each of the key-value pairs in the filter. If the value in such a pair is a string, then the annotation in the 'TestRun' must exactly match the value. If the value is a callable, rather than a string, then when passed the value from the 'TestRun', the predicate must return a true value.

GetTimeframe(self, time_key, is_iso_time=True)

source code 

Return a pair of min / max values found for the given time_key across all test runs.

'time_key' -- Annotation key referring to a string convertible to either iso-formatted time or floating point number.

returns -- minimum, maximum.