TestCenter Reference
TestSupport.Fields Namespace Reference

Package to handle all field related support functions. More...

Functions

def touch (fieldName, verbose=True)
 Touch the given field. More...
 
def setValues (fieldValueDict, verbose=True)
 Set field values to the given values. More...
 
def varyValues (function, funcParams, fieldDict, parentChangeSet=None, verbose=True)
 Set field values and for each combination call the given function with the given parameters. More...
 
def getValue (fieldName)
 Get value of the given field. More...
 
def setValue (fieldName, fieldValue, verbose=True)
 Set value of the given field. More...
 
def runFieldValueTestCase (fieldValueTestCaseSet, testCaseName, verbose=True)
 Run a field-value test case. More...
 

Detailed Description

Package to handle all field related support functions.

Function Documentation

◆ getValue()

def TestSupport.Fields.getValue (   fieldName)

Get value of the given field.

The value is converted to the correct type.

Returns
The value of the field.

Definition at line 93 of file Fields.py.

◆ runFieldValueTestCase()

def TestSupport.Fields.runFieldValueTestCase (   fieldValueTestCaseSet,
  testCaseName,
  verbose = True 
)

Run a field-value test case.

The given test case from the given field-value test case set is run, i.e. the parameterization is applied and the expected results are verified. TODO Results are not saved yet.

Parameters
fieldValueTestCaseSetThe field-value test case set the test case is from.
testCaseNameThe name of the test case to run.
verboseRun the field-value test case verbose.

Definition at line 142 of file Fields.py.

◆ setValue()

def TestSupport.Fields.setValue (   fieldName,
  fieldValue,
  verbose = True 
)

Set value of the given field.

The global changeset is used to track the field-value change. An info message will be sent to the log if verbose is selected.

Parameters
fieldNameThe identifier of the field to change.
fieldValueThe new value of the field.
verboseDetermine whether a message should be sent to the logfile.

Definition at line 130 of file Fields.py.

References TestSupport.ChangeSet.setFieldValue().

◆ setValues()

def TestSupport.Fields.setValues (   fieldValueDict,
  verbose = True 
)

Set field values to the given values.

The global change-set is used to reset the state after the test function has been processed.

Parameters
fieldValueDictDictionary with fieldnames as keys and fieldvalues as values used to change the context.

Definition at line 43 of file Fields.py.

◆ touch()

◆ varyValues()

def TestSupport.Fields.varyValues (   function,
  funcParams,
  fieldDict,
  parentChangeSet = None,
  verbose = True 
)

Set field values and for each combination call the given function with the given parameters.

Use an empty list ([]) if no parameters are required for the function.

Parameters
functionFunction to call for each field-value combination.
funcParamsList of parameters to call the function with.
fieldDictDictionary with field-names and their respective value lists.
parentChangeSetChangeset to use for setting the values.

Definition at line 58 of file Fields.py.