API for Packages

Part of the Object based program API.

class PackageApi

API to access Packages

Returned by

ExpectationApi

Returns the ExpectationApi namespace.

Returns:

ExpectationApi namespace

Return type:

ExpectationApi

ExpressionApi

Returns the ExpressionApi namespace.

Returns:

ExpressionApi namespace

Return type:

ExpressionApi

MappingApi

Returns the MappingApi namespace.

Returns:

MappingApi namespace

Return type:

MappingApi

SignalRecordingApi

Returns the SignalRecordingApi namespace.

Returns:

SignalRecordingApi namespace

Return type:

SignalRecordingApi

TestStepApi

Returns the TestStepApi namespace.

Returns:

TestStepApi namespace

Return type:

TestStepApi

TraceAnalysisApi

Returns the TraceAnalysisApi namespace.

Returns:

TraceAnalysisApi namespace

Return type:

TraceAnalysisApi

VariableApi

Returns the VariableApi namespace.

Returns:

VariableApi namespace

Return type:

VariableApi

CreateAnalysisPackage()

Creates a new analysis package.

Returns:

New empty analysis package

Return type:

AnalysisPackage

CreatePackage()

Creates a new package.

Returns:

New empty package

Return type:

Package

GetAnalysisPackageByTestManagementId(testManagementId)

Returns an existing analysis package holding the given test management id or None, if no matching analysis package exists in the workspace. If found, the analysis package will be opened.

Parameters:
testManagementId : str

The test management id identifying the analysis package

Returns:

the analysis package or None, if no matching item exists within the workspace

Return type:

AnalysisPackage

GetAnalysisPackageChanges(oldPackage, newPackage)

Get the changes that exist between two given analysis packages.

Parameters:
oldPackage

The old package to compare.

newPackage

The new package to compare.

Returns:

The changes that exist between the two analysis packages.

Return type:

list[Change]

GetAnalysisPackagePathsByTestscriptId(testscriptId)

Returns paths of packages which holding the given test script id.

Parameters:
testscriptId : str

The test management id identifying the package

Returns:

list of file paths

Return type:

list[str]

GetChanges(oldPackage, newPackage)

Get the changes that exist between two given packages.

Parameters:
oldPackage

The old package to compare.

newPackage

The new package to compare.

Returns:

The changes that exist between the two packages.

Return type:

list[Change]

GetPackageByTestManagementId(testManagementId)

Returns an existing package holding the given test management id or None, if no matching package exists in the workspace. If found, the package will be opened.

Parameters:
testManagementId : str

The test management id identifying the package

Returns:

the package or None, if no matching package exists within the workspace

Return type:

Package

GetPackagePathsByTestscriptId(testscriptId)

Returns paths of packages which holding the given test script id.

Parameters:
testscriptId : str

The test management id identifying the package

Returns:

list of file paths

Return type:

list[str]

GetTestManagementIdByPath(filename)

Returns the test script id for a given Package or Analysis Package filename. If the corresponding item has no id or if it does not exist, an empty string is returned.

Parameters:
filename : str

Absolute path to the package or analysis package file or relative path in regard to the package directory

Returns:

The test script id of an empty string

Return type:

str

OpenAnalysisPackage(filename)

Opens an existing analysis package. The analysis package may not be opened in ecu.test.

Parameters:
filename : str

Absolute path to the analysis package file or relative path in regard to the package directory

Returns:

Existing package

Return type:

AnalysisPackage

OpenPackage(filename)

Opens an existing package. The package may not be opened in ecu.test.

Parameters:
filename : str

Absolute path to the package file or relative path in regard to the package directory

Returns:

Existing package

Return type:

Package

SearchAnalysisPackages(searchCriteria, useExtendedMode=False)
Searches the current workspace and library workspaces for analysis packages matching

the given search criteria.

Parameters:
searchCriteria : str

The search criteria expressed in the ecu.test filter syntax. See section “Handling” => “Filter” of the ecu.test User Documentation.

useExtendedMode : boolean

If True, extended search strings are enabled. The default is False, meaning each word in the searchCriteria will be enclosed by wildcards and mapped to the filename. (e.g. “hello world” => “Name = ‘*hello*’ and Name = ‘*world*’”)

Returns:

All matching analysis packages. If no item matches, an empty list is returned.

Return type:

list[AnalysisPackage]

Raises:

ApiError – If the searchCriteria has an illegal syntax.

SearchPackages(searchCriteria, useExtendedMode=False)

Searches the current workspace and library workspaces for packages matching the given search criteria.

Parameters:
searchCriteria : str

The search criteria expressed in the ecu.test filter syntax. See section “Handling” => “Filter” of the ecu.test User Documentation.

useExtendedMode : boolean

If True, extended search strings are enabled. The default is False, meaning each word in the searchCriteria will be enclosed by wildcards and mapped to the filename. (e.g. “hello world” => “Name = ‘*hello*’ and Name = ‘*world*’”)

Returns:

All matching packages. If no package matches, an empty list is returned.

Return type:

list[Package]

Raises:

ApiError – If the searchCriteria has an illegal syntax.