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

Class RunDatabase

source code

         object --+    
                  |    
extension.Extension --+
                      |
                     RunDatabase

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.
source code
 
GetRuns(self, predicate)
Return the set of 'TestRun's satisfying 'predicate'
source code
 
GetAnnotations(self, key)
Return the set of annotations for 'key' from all test runs.
source code
 
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.
source code
 
GetRunInTimeframe(self, key, value, time_key, minimum, maximum, is_iso_time=True)
Return a test run id matching the key and timeframe.
source code
 
GetRunsByAnnotations(self, annotation_filter)
Return the 'TestRun's matching 'annotation_filter'.
source code
 
GetOutcomes(self, id, kind='test')
Return an outcome dictionary for the indicated test.
source code

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

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

Class Variables [hide private]

Inherited from extension.Extension: arguments, kind

Properties [hide private]

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.

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.

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.

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.

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.

GetOutcomes(self, id, kind='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.