The Assimilation Project  based on Assimilation version 1.1.7.1474836767
querytest.QueryTest Class Reference
Inheritance diagram for querytest.QueryTest:
Collaboration diagram for querytest.QueryTest:

Public Member Functions

def __init__ (self, store, querystring, classfactory, debug=False)
 
def check (self, objectlist, validator=None, minrows=None, maxrows=None, maxtries=300, delay=1)
 
def checkone (self, objectlist, validator=None, minrows=None, maxrows=None, debug=None)
 

Data Fields

 store
 
 db
 
 querystring
 
 debug
 
 classfactory
 

Detailed Description

This class performs queries and validates that the results
meet some specific criteria.
This class is a component of our system test tools - not part of
the operational software.

The general idea is that after a test completes, we can see if it updated
the database correctly by running some particular query whose results
can be evaluated for correctness.

Definition at line 45 of file querytest.py.

Constructor & Destructor Documentation

def querytest.QueryTest.__init__ (   self,
  store,
  querystring,
  classfactory,
  debug = False 
)
Init function for the QueryTest class
The querystring we're given will be given to the string <i>format</i> method
along with a set of objects passed in to runandcheck() to create the final query.

Definition at line 56 of file querytest.py.

Member Function Documentation

def querytest.QueryTest.check (   self,
  objectlist,
  validator = None,
  minrows = None,
  maxrows = None,
  maxtries = 300,
  delay = 1 
)
We run a query using _checkone_ repeatedly until we like the results or give up...
It's hard to know when everything is done like it ought to be...
Maxtries is the maximum of attempts to make for getting good query results
Delay is the how long to wait between query calls

Definition at line 69 of file querytest.py.

References querytest.QueryTest.checkone().

Here is the call graph for this function:

def querytest.QueryTest.checkone (   self,
  objectlist,
  validator = None,
  minrows = None,
  maxrows = None,
  debug = None 
)
We run a query and see if we like the results:
- use the format() method to format the query using the objects in <i>objectlist</i>
- run the query
- validate the results of the query by calling <i>validator</i> on each row retrieved

We return False if the validator dislikes any query row, or if the wrong number of
rows was returned, and True if everything looks good.

Definition at line 87 of file querytest.py.

References querytest.QueryTest.classfactory, cma.cmadb.CMAdb.debug, cma.discoverylistener.DiscoveryListener.debug, querytest.QueryTest.debug, logwatcher.LogWatcher.debug, cma.store.Store.debug, docker.DockerSystem.debug, and docker.SystemTestEnvironment.debug.

Referenced by querytest.QueryTest.check().

Here is the caller graph for this function:

Field Documentation

querytest.QueryTest.classfactory

Definition at line 65 of file querytest.py.

Referenced by querytest.QueryTest.checkone().

querytest.QueryTest.db

Definition at line 62 of file querytest.py.

querytest.QueryTest.querystring

Definition at line 63 of file querytest.py.


The documentation for this class was generated from the following file: