SwitchDefCase¶
- class SwitchDefCase¶
Returned by
- AppendTraceStep(traceStep)¶
Adds a trace step at the end of its children.
- Parameters:
- traceStep¶
Trace step to be added
- Clone()¶
Call this method if you want to use API-objects in multiple contexts, e.g. if you want to insert a specific test step in multiple blocks.
- Returns:
A copy of this object
- Return type:
-
CreateCaseNode(insertPosition=
None)¶ Creates and returns a newly created case node.
- Parameters:
- insertPosition : int¶
Specifies the insert position of the new case node. If unspecified or too large the new case node will be inserted before the default node.
- Returns:
The specified case node
- Return type:
- GetCaseNode(index)¶
Returns the specified case node.
- Parameters:
- index : int¶
Specifies the index of the case node to return
- Returns:
The specified case node
- Return type:
- GetCaseNodes()¶
Returns the list of the case nodes.
- Returns:
List of case nodes
- Return type:
list[
CaseDefNode]
- GetDescription()¶
Returns an empty text. A SwitchDef does not have a description.
- Returns:
The description
- Return type:
str
- GetIndex()¶
Returns the zero based index in the parent.
- Returns:
Zero based index
- Return type:
int
- GetLineNo()¶
Returns the trace steps line number within its trace analysis.
- Returns:
Line number
- Return type:
int
- GetName()¶
Returns the name of the trace analysis element.
- Returns:
The name
- Return type:
str
- GetSwitchValue()¶
Returns the constant expression examined in the SwitchDef.
- Returns:
Constant expression of the SwitchDef
- Return type:
str
- GetTags()¶
Returns the tags set for this step.
- Returns:
A (sorted) list of tags
- Return type:
list[str]
-
GetTraceSteps(skipDisabledSteps=
False, recursive=False)¶ Returns either direct or all children of the trace step.
- GetType()¶
Returns the type (class name) of the trace step, e.g.
‘Episode’
‘AnalysisBlock’
‘TriggerBlock’
‘Calculation’
‘TemplateBasedTraceStep’
‘TraceAnalysisReference’
‘TraceAnalysisReferenceDeprecated’
- Returns:
Type (class name) of the trace step
- Return type:
str
- GetUuid()¶
Returns the UUID of the trace step.
- Returns:
UUID of the trace step
- Return type:
str
- IsContainer()¶
Checks whether this trace step can contain trace steps.
- Returns:
True if it can contain trace steps, else False
- Return type:
boolean
- IsDefaultError()¶
Returns the behavior of the default case. If set to True and the constant expression does not match with any of the expected cases the analysis will result in an ‘ERROR’.
- Returns:
Truth value of the current state
- Return type:
boolean
- IsEnabled()¶
Checks whether the trace step is enabled.
- Returns:
True if trace step is enabled, else False
- Return type:
boolean
- IsOk()¶
Returns the internal state of correctness of the trace step.
- Returns:
True if no problems were found, else False
- Return type:
boolean
- IsVisible()¶
Checks whether the trace step is visible. This depends on the trace step itself or a parent trace step being disabled.
- Returns:
True if trace step is visible, else False
- Return type:
boolean
- RemoveTraceStep(traceStep)¶
Removes the given trace step from the trace analysis.
- Parameters:
- traceStep¶
Trace step to be removed
- SetDefaultError(defaultError)¶
Sets the state of the default case behavior. If set to True and the constant expression does not match with any of the expected cases the analysis will result in an ‘ERROR’.
- Parameters:
- defaultError : boolean¶
If set to True, enter the default case will result in an error at runtime.
- SetDescription(value)¶
No operation. A SwitchDef block does not have a description.
- Parameters:
- value : str¶
The new description
- SetEnabled(enable)¶
Enables or disables the trace step (this also affects child trace steps).
- Parameters:
- enable : boolean¶
If True, enables the trace step, if False, disables the trace step
- SetName(name)¶
No operation. The name of a SwitchDef cannot be changed.
- Parameters:
- name : str¶
The new name
- SetSwitchValue(switchValue)¶
Sets the constant expression examined in the SwitchDef.
- Parameters:
- switchValue : str¶
Constant expression of the SwitchDef