TestCenter Reference
TestSupport.FieldValueTests.FieldValueTestCase Class Reference

A class implementing the field-value test cases. More...

Inheritance diagram for TestSupport.FieldValueTests.FieldValueTestCase:

Classes

class  FieldList
 List of field information. More...
 
class  FieldListBase
 Superclass for the field lists used in the field-value test case. More...
 
class  FieldValueList
 List of field information including field values. More...
 

Public Member Functions

def __init__ (self, name, ctx, xmlNode=None)
 The default constructor. More...
 
def getName (self)
 Return the name of the field-value test case. More...
 
def setName (self, name)
 Set the name of the field-value test case. More...
 
def save (self, xmlNode=None)
 Save the settings of this field-value test case to an XML node. More...
 
def getParameterization (self)
 Return the parameterization set. More...
 
def applyParameterization (self, changeSet, verbose=False)
 Apply the parameterization to the context given in the constructor. More...
 
def getExpectedResults (self)
 Getter for the list of expected results. More...
 
def verifyExpectedResults (self, failedFieldList=[], findAll=False, verbose=False)
 Return the expected result set. More...
 
def getResultsToSave (self)
 Return the results to save. More...
 
def saveResults (self, name, overwrite=False)
 Save the given field values to the xml data structure. More...
 
def getSavedResultList (self)
 Get a sorted list of names of the saved results. More...
 
def addSavedResultList (self, name, resultList)
 Add saved results. More...
 
def getSavedResult (self, name)
 Get the field-value list saved under the given name. More...
 

Detailed Description

A class implementing the field-value test cases.

A field-value test case is given via three lists of fields. In a first step some fields are set to the specified values (a parameterization). Than certain fields are verified whether they have the expected values set (the expected results). Finally the values of certain fields are saved (the results to save).

Definition at line 513 of file FieldValueTests.py.

Constructor & Destructor Documentation

◆ __init__()

def TestSupport.FieldValueTests.FieldValueTestCase.__init__ (   self,
  name,
  ctx,
  xmlNode = None 
)

The default constructor.

Set the required member variables and load the settings from the XML node if one given.

Parameters
nameThe name of the field-value test case.
ctxThe context the field-value test case operates on.
xmlNodeThe node the field-value test case is defined in.

Definition at line 730 of file FieldValueTests.py.

References TestSupport.ChangeSet.ChangeSet.__ctx, TestCenterAdvanced.Slave.Slave.__ctx, TestSupport.FieldValueTests.FieldValueTestCaseSet.__ctx, TestSupport.FieldValueTests.FieldValueTestCase.__ctx, TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict, TestCenterAdvanced.Config.Configuration.__load(), TestSupport.FieldValueTests.FieldValueTestCase.__load(), and TestSupport.FieldValueTests.FieldValueTestCase.__name.

Member Function Documentation

◆ addSavedResultList()

def TestSupport.FieldValueTests.FieldValueTestCase.addSavedResultList (   self,
  name,
  resultList 
)

Add saved results.

Returns
True if succeeded.

Definition at line 888 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.

◆ applyParameterization()

def TestSupport.FieldValueTests.FieldValueTestCase.applyParameterization (   self,
  changeSet,
  verbose = False 
)

Apply the parameterization to the context given in the constructor.

The change set given is used to make the parameterization revertable (except for the touched triggers).

Parameters
changeSetThe change set to use.
verboseRun the parameterization in verbose mode.

Definition at line 798 of file FieldValueTests.py.

References TestSupport.ChangeSet.ChangeSet.__ctx, TestCenterAdvanced.Slave.Slave.__ctx, TestSupport.FieldValueTests.FieldValueTestCaseSet.__ctx, TestSupport.FieldValueTests.FieldValueTestCase.__ctx, TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict, and TestSupport.Fields.touch().

◆ getExpectedResults()

def TestSupport.FieldValueTests.FieldValueTestCase.getExpectedResults (   self)

Getter for the list of expected results.

Returns
The field-value list of expected results.

Definition at line 810 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.

◆ getName()

def TestSupport.FieldValueTests.FieldValueTestCase.getName (   self)

Return the name of the field-value test case.

Returns
The name of the field-value test case.

Definition at line 746 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__name.

◆ getParameterization()

def TestSupport.FieldValueTests.FieldValueTestCase.getParameterization (   self)

Return the parameterization set.

Returns
The field-value list that describes the parameterization.

Definition at line 788 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.

◆ getResultsToSave()

def TestSupport.FieldValueTests.FieldValueTestCase.getResultsToSave (   self)

Return the results to save.

Returns
The list of fields that should be saved.

Definition at line 850 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.

◆ getSavedResult()

def TestSupport.FieldValueTests.FieldValueTestCase.getSavedResult (   self,
  name 
)

Get the field-value list saved under the given name.

Parameters
nameThe name of the saved result to return.

Definition at line 911 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.

◆ getSavedResultList()

def TestSupport.FieldValueTests.FieldValueTestCase.getSavedResultList (   self)

Get a sorted list of names of the saved results.

Returns
Sorted list of saved results.

Definition at line 881 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.

◆ save()

def TestSupport.FieldValueTests.FieldValueTestCase.save (   self,
  xmlNode = None 
)

Save the settings of this field-value test case to an XML node.

If no node is given an empty new one is created.

Parameters
xmlNodeThe node used for the field-value test case.
Returns
The XML node the settings were saved to.

Definition at line 762 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict, and TestSupport.FieldValueTests.FieldValueTestCase.__name.

◆ saveResults()

def TestSupport.FieldValueTests.FieldValueTestCase.saveResults (   self,
  name,
  overwrite = False 
)

Save the given field values to the xml data structure.

Please note that this won't save to the file! Use the FieldValueTestCaseSet containing this FieldValueTestCase.

Parameters
nameThe results are saved under the given name and this name must be unique!

Definition at line 860 of file FieldValueTests.py.

References TestSupport.ChangeSet.ChangeSet.__ctx, TestCenterAdvanced.Slave.Slave.__ctx, TestSupport.FieldValueTests.FieldValueTestCaseSet.__ctx, TestSupport.FieldValueTests.FieldValueTestCase.__ctx, TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict, and TestSupport.Fields.touch().

◆ setName()

def TestSupport.FieldValueTests.FieldValueTestCase.setName (   self,
  name 
)

Set the name of the field-value test case.

Parameters
nameThe new name of the field-value test case.

Definition at line 753 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__name.

◆ verifyExpectedResults()

def TestSupport.FieldValueTests.FieldValueTestCase.verifyExpectedResults (   self,
  failedFieldList = [],
  findAll = False,
  verbose = False 
)

Return the expected result set.

Returns
The field-value list that describes the expected results. Use the given field-value list to verify the given context's field values.
Parameters
failedFieldListList of fields that have wrong values.
findAllIf false the method will return on the first error.
verboseRun the verification in verbose mode.
Returns
True if the expected results were found.

Definition at line 822 of file FieldValueTests.py.

References TestSupport.ChangeSet.ChangeSet.__ctx, TestCenterAdvanced.Slave.Slave.__ctx, TestSupport.FieldValueTests.FieldValueTestCaseSet.__ctx, TestSupport.FieldValueTests.FieldValueTestCase.__ctx, and TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.


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