AnalysisPackage

class AnalysisPackage

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.

Parameters:
relation

relation to add

AddVariable(variable)

Adds a variable to the package.

Parameters:
variable

Variable 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

GetMapping()

Returns the local mapping of the analysis 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]

GetRelations()

Returns relations.

Returns:

relations

Return type:

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

GetTraceAnalysis()

Returns the trace analysis of the analysis package.

Returns:

The trace analysis of the analysis package

Return type:

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

HasSpecificationFlag()

Returns the state of the specification flag.

Returns:

True if specification 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

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.

Parameters:
relation

relation to remove

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, allowCompatibilityFallback=False)

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())

allowCompatibilityFallback : bool

If True and the workspace compatibility mode is active, a compatibility conflict does not abort saving. Instead, the file is saved in the minimum compatible version. If False and the workspace compatibility mode is active, a compatibility conflict raises an exception. If the workspace compatibility mode is inactive, the argument is ignored.

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

SetSpecificationFlag(state=True)

Sets the specification flag.

Parameters:
state : bool

True to enable, False to disable the specification 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

SetTraceAnalysis(traceAnalysis)

Sets the trace analysis of the analysis package.

Parameters:
traceAnalysis

Trace analysis to be set

SetVersion(version)

Sets the package version.

Parameters:
version : str

Version to be shown in the package properties