TestCenter Reference
TestSupport.FieldValueTests.FieldValueTestCase Class Reference

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

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

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

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 516 of file FieldValueTests.py.

Constructor & Destructor Documentation

◆ __init__()

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 733 of file FieldValueTests.py.

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

Member Function Documentation

◆ addSavedResultList()

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

Add saved results.

Returns
True if succeeded.

Definition at line 891 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.

◆ applyParameterization()

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 801 of file FieldValueTests.py.

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

◆ getExpectedResults()

TestSupport.FieldValueTests.FieldValueTestCase.getExpectedResults ( self)

Getter for the list of expected results.

Returns
The field-value list of expected results.

Definition at line 813 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.

◆ getName()

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 749 of file FieldValueTests.py.

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

Referenced by TestCenterAdvanced.TestCase.TestCase.openFiles(), and TestCenterAdvanced.TestCase.TestCase.run().

◆ getParameterization()

TestSupport.FieldValueTests.FieldValueTestCase.getParameterization ( self)

Return the parameterization set.

Returns
The field-value list that describes the parameterization.

Definition at line 791 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.

◆ getResultsToSave()

TestSupport.FieldValueTests.FieldValueTestCase.getResultsToSave ( self)

Return the results to save.

Returns
The list of fields that should be saved.

Definition at line 853 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.

◆ getSavedResult()

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 914 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.

◆ getSavedResultList()

TestSupport.FieldValueTests.FieldValueTestCase.getSavedResultList ( self)

Get a sorted list of names of the saved results.

Returns
Sorted list of saved results.

Definition at line 884 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict.

◆ save()

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 765 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCase.__fieldValueListDict, TestSupport.FieldValueTests.FieldValueTestCase.__name, TestSupport.FieldValueTests.FieldValueTestCase.FieldListBase.__name, and TestSupport.FieldValueTests.FieldValueTestCase.save().

Referenced by TestCenterAdvanced.Config.Configuration.__init__(), and TestSupport.FieldValueTests.FieldValueTestCase.save().

◆ saveResults()

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 863 of file FieldValueTests.py.

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

◆ setName()

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 756 of file FieldValueTests.py.

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

◆ verifyExpectedResults()

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 825 of file FieldValueTests.py.

References TestCenterAdvanced.Slave.Slave.__ctx, TestSupport.ChangeSet.ChangeSet.__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: