Package

class Package

Returned by

Attributes

Returns access to the package attributes definitions specified within the parameter set and the referenced package attribute definition files.

Returns:

Package attribute interface of the parameter set

Return type:

Attributes

AddRelation(relation)

Add relation :param relation: :type relation: Relation

AddVariable(variable)

Adds a variable to the package.

Parameters:
variable

Variable to be added

AppendTestStep(testStep)

Adds a test step at the end of the test case.

Parameters:
testStep

Test step to be added

AppendTraceAnalysis(traceAnalysis)

Adds a trace analysis to the trace analyses list.

Parameters:
traceAnalysis

Trace analysis to be added

Close()

Closes the package. After closing the package it can not be modified/accessed anymore.

GetActivationCondition()

Gets the activation condition for this package.

Returns:

The expression defining the activation condition

Return type:

str

GetDescription()

Returns the package description.

Returns:

Description shown in the package properties

Return type:

str

GetFilename()

Returns the file name of the package file as absolute path, if this is a file. If not it may be unsaved.

Returns:

The file name of the saved file or None, if not a file

Return type:

str

GetImplementedKeywordInterfaceId()

Returns the ID of the implemented keyword interface, if set and the package is marked as keyword implementation.

Returns:

Implemented keyword interface ID. If not yet set, an empty string will be returned.

Return type:

str

Raises:

ApiError – If the “keyword implementation” flag is not set.

GetKeywordImplementationLanguage()

Returns the implementation language (“de_DE” or “en_US”) of the current package, if it is marked as keyword implementation.

Returns:

The implementation language of this package, if explicitly set. “None” will be returned otherwise.

Return type:

str

Raises:

ApiError – If the “keyword implementation” flag is not set.

GetMapping()

Returns the local mapping of the package.

Returns:

Mapping of the package

Return type:

LocalMapping

GetName()

Returns the package name.

Returns:

Package name.

Return type:

str

GetParameterVariables()

Returns a list of all variables defined in the analysis package and set as a parameter.

Returns:

List of all defined parameters

Return type:

list[Variable]

GetPostconditionBlock()

Returns the postcondition block.

Returns:

Postcondition block or None, if none existing

Return type:

TsPostconditionBlock

GetPreconditionBlock()

Returns the precondition block.

Returns:

Precondition block or None, if none existing

Return type:

TsPreconditionBlock

GetRecordedVariables()

Returns a list of all variables defined in the package and set as a recorded variable.

Returns:

List of all recorded variables

Return type:

list[Variable]

GetRecordingConfig()

Returns the recording configuration to configure signal groups, recording groups, signals to record, synchronizations and other settings.

Returns:

The recording configuration

Return type:

RecordingConfig

GetRelations()

Returns relations :return: relations :rtype: list[Relation]

GetReturnVariables()

Returns a list of all variables defined in the package and set as a return variable.

Returns:

List of all defined return variables

Return type:

list[Variable]

GetTestScriptId()

Returns the test script id of the package.

Returns:

Test script id.

Return type:

str

GetTestStepByLineNo(lineNo)

Searches for the line number and returns the test step, if existing.

Parameters:
lineNo : integer

Line number of the test step to be retrieved

Returns:

Test step at the current line number or None if no test step exists

Return type:

TestStep

GetTestSteps(skipDisabledSteps=True, recursive=False, whiteList=None, blackList=None)

Returns the children of the test step.

Parameters:
skipDisabledSteps : boolean

Defines whether disabled test steps should be excluded.

recursive : boolean

Specifies whether only the direct children of the test step or recursively all test steps from the complete test step tree should be returned.

whiteList : list[str]

If specified, only those test steps whose class name is on this list are returned.

blackList : list[str]

If specified, only those test steps whose class name is not on this list are returned.

Returns:

List with all children test steps

Return type:

list[TestStep]

GetTraceAnalyses()

Returns all trace analyses of the package.

Returns:

The trace analyses of the package

Return type:

list[TraceAnalysis]

GetType()
Returns the type (class name) of the package, e.g.
  • “Package”

  • “AnalysisPackage”

Returns:

Type (class name) of the package

Return type:

str

GetUnusedVariables()

Returns the list of unused variables defined in the package.

Returns:

List of all unused defined variables

Return type:

list[Variable]

GetVariable(name)

Returns the variable defined in the package with a specific name.

Parameters:
name : string

The name of the variable

Returns:

Variable with the specified name or None

Return type:

Variable

GetVariables()

Returns a list of all variables defined in the package.

Returns:

List of all defined variables

Return type:

list[Variable]

GetVersion()

Returns the package version.

Returns:

Version shown in the package properties

Return type:

str

HasSegmentationPackageFlag()

Returns the state of the segmentation package flag.

Returns:

True if the segmenation package flag is enabled, otherwise False.

Return type:

bool

HasSpecificationFlag()

Returns the state of the specification flag.

Returns:

True if specification flag is enabled, otherwise False

Return type:

bool

HasStimulationPackageFlag()

Returns the state of the stimulation package flag.

Returns:

True if stimulation package flag is enabled, otherwise False

Return type:

bool

HasTestCaseFlag()

Returns the state of the test case flag.

Returns:

True if test case flag is enabled, otherwise False

Return type:

bool

HasTraceAnalyses()

Returns True if the package has trace analyses.

Returns:

True if the package has trace analyses

Return type:

boolean

ImplementsKeyword()

Checks if current package is marked as a keyword interface implementation.

Returns:

“True”, if package is marked as a keyword interface implementation else “False”.

Return type:

boolean

InsertTestStep(testStep, position)

Adds a test step at a certain line of the test case.

Parameters:
testStep

Test step to be added

position : integer

Target index of child beginning with 0

IsActivationConditionFulfilled()

Evaluates the activation condition defined in the package.

Returns:

True, if the activation condition is fulfilled.

Return type:

bool

Raises:

ApiError – If the activation condition is not evaluable

RemoveRelation(relation)

Remove relation :param relation: :type relation: Relation

RemoveTestStep(testStep)

Removes the given test step from the test case.

Parameters:
testStep

Test step to be removed

RemoveTraceAnalysis(traceAnalysisName)

Removes a trace analysis from the trace analyses list.

Parameters:
traceAnalysisName : str

Name of trace analysis to be removed

RemoveVariable(variableName)

Removes a variable from the package.

Parameters:
variableName : str

Name of variable to be removed

RenameVariable(oldVarName, newVarName)

Renames a existing variable of the package.

Parameters:
oldVarName : str

The old variable name

newVarName : str

The new variable name

Save(filename=None)

Saves the package. Appends file ending if needed.

Parameters:
filename : str

File name of the package; Either absolute or relative to the ‘Packages’ directory. Leave out to save the package to its existing file (previously set with Save() or from PackageApi.OpenPackage())

SetActivationCondition(expression)

Sets the activation condition for this package.

Parameters:
expression : str

The expression defining the activation condition

SetDescription(description)

Sets the package description.

Parameters:
description : str

Description to be shown in the package properties

SetImplementedKeywordInterfaceId(implId)

Sets the ID of the implemented keyword interface, package must be marked as a keyword implementation before.

Parameters:
implId : str

ID of the implemented keyword interfaces or empty.

Raises:

ApiError – If the “keyword implementation” flag is not set.

SetImplementsKeywordFlag(state)

Sets the state of the “keyword implementation” flag.

Parameters:
state : boolean

If “state” is “True”, this package will be marked as a keyword interface implementation, otherwise an eventually existing mark will be removed.

SetKeywordImplementationLanguage(implLanguage)

Sets the implementation language of the current package. Package must be marked as a keyword implementation before.

Parameters:
implLanguage : str

Implementation language “de_DE” or “en_US”. Or “None” to reset the current setting to program language.

Raises:

ApiError – If the “keyword implementation” flag is not set.

SetSegmentationPackageFlag(state=True)

Sets the segmentation package flag.

Parameters:
state : bool

True to enable, False to disable the segmentation package flag.

SetSpecificationFlag(state=True)

Sets the specification flag.

Parameters:
state : bool

True to enable, False to disable the specification flag

SetStimulationPackageFlag(state=True)

Sets the stimulation package flag.

Parameters:
state : bool

True to enable, False to disable the stimulation package flag

SetTestCaseFlag(state=True)

Sets the test case flag.

Parameters:
state : bool

True to enable, False to disable the test case flag

SetTestScriptId(testSriptId)

Sets the test script id of the package.

Parameters:
testSriptId : str

Test script id

SetVersion(version)

Sets the package version.

Parameters:
version : str

Version to be shown in the package properties