TsCall

class TsCall

Returned by

AddParameter(parameterName, valueExpression=None, repr='PHYS', unit="don't care")

Adds a parameter to the test step.

See also UpdateInterface() and the various SetParameter... methods.

Parameters:
parameterName : str

name of the parameter

valueExpression : str

expression to use for the parameter’s value

repr : str

Representation. One of ~ApiClient.PHYS, ~ApiClient.RAW, ~ApiClient.TEXT or ~ApiClient.BITS

unit : str

Unit of the parameter

AddReturnValue(returnName, saveIn=None, expectation=None, repr='PHYS', unit="don't care")

Adds a return value to the test step.

See also UpdateInterface() and the various SetReturnValue... methods.

Parameters:
returnName : str

name of the return value

saveIn : str

name of the variable to save the return value into

expectation=None

Expectation for the return value

repr : str

Representation. One of ~ApiClient.PHYS, ~ApiClient.RAW, ~ApiClient.TEXT or ~ApiClient.BITS

unit : str

Unit of the return value

AddTag(tag)

Add a specific tag to this step.

Parameters:
tag : str

The tag to be set

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:

TsCall

DeactivateReturnValueExpectation(returnName)

Deactivates the expectation for the specified return value.

If no return value with an expectation remains, also deactivates any time option that may be configured.

Parameters:
returnName : str

name of the return value

DeactivateReturnValueSaveIn(returnName)

Deactivates the save into a variable mechanism for the specified return value

Parameters:
returnName : str

name of the return value

DeactivateTimeOption()

Deactivates any time option set on the test step. This is equivalent to selecting the option “none” in the test step’s time options menu.

DeleteParameter(parameterName)

Removes a parameter from the test step.

See also UpdateInterface().

Parameters:
parameterName : str

name of the parameter

DeleteReturnValue(returnName)

Removes a return value from the test step. If no return values are left after the deletion, also deactivates any time option that may be configured.

See also UpdateInterface().

Parameters:
returnName : str

name of the return value

DeleteTranslatedCommentText(language)

Deletes a comment for the test step in the given language.

Parameters:
language : str

Language of the text (‘en_US’, ‘de_DE’, ‘zh_CN’)

GetActionColumnText()

Returns the text value of the “action” column.

Returns:

Action column text

Return type:

str

GetActiveTimeOptionType()

Returns the type of the currently active time option.

Returns:

Type of active time option (“Timeless”, “Finally”, “TrueForWithin”, “Generally”, “SyncOnly”, “PollingCycleMultiplier”)

Return type:

string

GetComment()

Returns the comment of the test step in the current test case language.

Returns:

Comment text as shown in the comment tab

Return type:

str

GetCommentColumnText()

Returns the text value of the “comment” column.

Returns:

Comment column text

Return type:

str

GetCycleTimeExpression()

Gets the cycle time expression for this test step.

Returns:

cycle time expression in milliseconds

Return type:

str

GetCyclicState()

Gets the cyclic sending state for this test step.

Returns:

‘on’, ‘off’, ‘unchanged’ or None

Return type:

str

GetError()

Returns a list of errors. Note that the error messages depend on the program language ecu.test is set to. Because of that we do not recommend to check against exact error messages, unless you are certain about the respective program language.

Returns:

List of errors

Return type:

list[str]

GetIgnoreResponse()

Returns test step’s option for ignoring its response.

Raises:

ApiError – If not return values or ignoring the response is not supported the option does not make sense.

Returns:

Returns the value of the option.

Return type:

bool

GetIndex()

Returns the zero based index in the parent.

Returns:

Zero based index

Return type:

integer

GetLineNo()

Returns the test steps line number within its test case.

Returns:

Line number

Return type:

int

GetMappingItemReferenceName()

Returns the unique reference name of the mapping item used by this test step.

Returns:

Reference name of used mapping item

Return type:

str

GetMinimumDuration()

Returns the minimum duration of the test step’s time option, if a corresponding option has been set.

Returns:

The minimum duration, else None

Return type:

string

GetMinimumDurationUnit()

Returns the unit of the minimum duration of the test step’s time option, if a corresponding option has been set.

Returns:

The unit of the minimum duration, else None

Return type:

string

GetPacketExpectation()

Returns the expectation for the packet

Returns:

expectation

Return type:

Expectation

GetParameterColumnText()

Returns the text value of the “parameter” column.

Returns:

Parameter column text

Return type:

str

GetParameterNames()

Returns the names of the parameters defined in the test step.

Info

If the test step was created without a mapping item, or if the data base describing the target of the mapping item was not loaded, this list is initially empty. You can use AddParameter() or UpdateInterface() to populate it.

Returns:

Parameter names

Return type:

list[str]

GetParameterRepresentation(parameterName)

Returns the representation used for the specified parameter

Parameters:
parameterName : str

name of the parameter

Returns:

representation used for the parameter

Return type:

str

GetParameterUnit(parameterName)

Returns the unit for the specified parameter

Parameters:
parameterName : str

name of the parameter

Returns:

Unit used by the ~ApiClient.PHYS representation for this parameter

Return type:

str

GetParameterValue(parameterName)

Returns the value expression assigned to the specified parameter

Parameters:
parameterName : str

name of the parameter

Returns:

value expression assigned to the parameter

Return type:

str

GetParent()

Returns the parent test step.

Returns:

The parent test step or None if it is a top level test step.

Return type:

TestStep

GetPollingCycle()

Returns the polling cycle of the test step’s time option, if a corresponding option has been set.

Returns:

The polling cycle, else None

Return type:

string

GetPollingCycleUnit()

Returns the unit of the polling cycle of the test step’s time option, if a corresponding option has been set.

Returns:

The unit of the polling cycle, else None

Return type:

string

GetReturnNames()

Returns the names of the return values defined in the test step.

Info

If the test step was created without a mapping item, or if the data base describing the target of the mapping item was not loaded, this list is initially empty. You can use AddReturnValue() or UpdateInterface() to populate it.

Returns:

Return value names

Return type:

list[str]

GetReturnValueExpectation(returnName)

Returns the expectation for the specified return value

Parameters:
returnName : str

name of the return value

Returns:

expectation

Return type:

Expectation

GetReturnValueRepresentation(returnName)

Returns the representation used for the specified return value

Parameters:
returnName : str

name of the return value

Returns:

representation used for the return value

Return type:

str

GetReturnValueSaveIn(returnName)

Returns the variable name to save the specified return value in

Parameters:
returnName : str

name of the return value

Returns:

variable name

Return type:

str

GetReturnValueUnit(returnName)

Returns the unit for the specified return value

Parameters:
returnName : str

name of the return value

Returns:

Unit used by the ~ApiClient.PHYS representation for this return value

Return type:

str

GetTags()

Returns the tags set for this step.

Returns:

A (sorted) list of tags

Return type:

list[str]

GetTestManagementId()

Returns the test management id of the test step.

Returns:

Test step id.

Return type:

str

GetTestStepId()

Returns the test step id.

Returns:

test step id

Return type:

str

GetTimeout()

Returns the timeout of the test step’s time option, if a corresponding option has been set.

Returns:

The timeout else None

Return type:

string

GetTimeoutUnit()

Returns the unit of the timeout of the test step’s time option, if a corresponding option has been set.

Returns:

The unit of the timeout else None

Return type:

string

GetTranslatedCommentText(language)

Returns the text value of the “comment” column in the given language.

Parameters:
language : str

Language of the requested text (‘en_US’, ‘de_DE’, ‘zh_CN’)

Returns:

Comment column text

Return type:

str

GetType()

Returns the type (class name) of the test step, e.g.

  • “TsPreconditionBlock”

  • “TsWait”

  • “TsIfThenElse”

  • “TsSwitchCase”

  • “TsCaseNode”

Returns:

Type (class name) of the test step

Return type:

str

GetValueColumnText()

Returns the text value of the “value” column in your current test case language.

Returns:

Value column text

Return type:

str

IsBreakpoint()

Checks whether the test step is a break point.

Returns:

True if test step is a break point, else False

Return type:

boolean

IsContainer()

Checks whether this test step can contain test steps

Returns:

True if it can contain test steps, else False

Return type:

boolean

IsEnabled()

Returns the state of the test step.

Returns:

True if test step is enabled, otherwise False

Return type:

bool

IsInPostcondition()

Returns True if the test step is located in a postcondition

Returns:

True if the test step is located in a postcondition, else Flase

Return type:

bool

IsInPrecondition()

Returns True if the test step is located in a precondition

Returns:

True if the test step is located in a precondition, else False

Return type:

bool

IsOk()

Returns the internal state of correctness of the test step.

Returns:

True if no problems were found, else False

Return type:

boolean

IsVisible()

Checks whether the test step is visible. This depends on the test step itself or a parent test step being disabled.

Returns:

True if test step is visible, else False

Return type:

boolean

RemovePacketExpectation()

Removes the expectation for the packet. Only applicable if this test step is mapped to a service method/event.

RemoveTag(tag)

Remove a specific tag from this step.

Parameters:
tag : str

The tag to be removed

SetBreakpoint(enable)

Sets or unsets the test step to act as a break point.

Parameters:
enable : boolean

True if test step is a break point, else False

SetComment(comment)

Sets a comment for the test step in the current test case language.

Parameters:
comment : str

Text to be displayed in the comment tab

SetCyclic(cyclicState, cycleTimeExpression=None)

Changes the send cyclic settings for a test step that has call mode ‘SEND_EVENT’

Raises:

ApiError – if the test step doesn’t support cyclic sending

Parameters:
cyclicState : str

possible values are:

  • ’on’ enables cyclic sending using the specified cycleTimeExpression

  • ’off’ disables cyclic sending

  • ’unchanged’ keeps cyclic sending (e.g. if just the event’s values should be changed)

  • None removes cyclic settings so the test step will send the event just once

cycleTimeExpression : str

in milliseconds, necessary for cyclicState ‘on’

SetEnabled(state=True)

Enable or disable the test step.

Parameters:
state : bool

True (Default) to enable, False to disable the test step.

SetIgnoreResponse(ignoreResponse)

Sets test step’s option for ignoring its response.

Raises:

ApiError – If not return values or ignoring the response is not supported the option does not make sense.

Parameters:
ignoreResponse : bool

Sets the value of the option.

SetPacketExpectation(expectationExpression)

Sets the expectation for the packet. Only applicable if this test step is mapped to a service method/event.

This should be a ExpressionExpectation referencing the packet as value, a PresentExpectation, or a NotPresentExpectation.

Keep in mind that the value object can not only be a PacketSomeIp but also NotPresent.

Parameters:
expectationExpression

expectation for the return value

SetParameterRepresentation(parameterName, repr)

Sets the representation for the specified parameter

This method only works with existing parameters. To add a parameter please use AddParameter()

Parameters:
parameterName : str

name of the parameter

repr : str

representation to use for the parameter. One of ~ApiClient.PHYS, ~ApiClient.RAW, ~ApiClient.TEXT or ~ApiClient.BITS

SetParameterUnit(parameterName, unit)

Sets the unit for the specified parameter

This method only works with existing parameters. To add a parameter please use AddParameter()

Parameters:
parameterName : str

name of the parameter

unit : str

Unit to use for the ~ApiClient.PHYS representation for this parameter

SetParameterValue(parameterName, valueExpression)

Assigns a new expression to use the specified parameter’s value

This method only works with existing parameters. To add a parameter please use AddParameter()

Parameters:
parameterName : str

name of the parameter

valueExpression : str

expression to use for the parameter’s value

SetReturnValueExpectation(returnName, expectationExpression)

Sets the expectation for the specified return value.

This method only works with existing return values. To add a return value please use AddReturnValue()

Parameters:
returnName : str

name of the return value

expectationExpression

expectation for the return value

SetReturnValueRepresentation(returnName, repr)

Sets the representation for the specified return value

This method only works with existing return values. To add a return value please use AddReturnValue()

Parameters:
returnName : str

name of the return value

repr : str

representation to use for the return value. One of ~ApiClient.PHYS, ~ApiClient.RAW, ~ApiClient.TEXT or ~ApiClient.BITS

SetReturnValueSaveIn(returnName, saveInVariableName)

Sets the variable name to save the specified return value in

This method only works with existing return values. To add a return value please use AddReturnValue()

Parameters:
returnName : str

name of the return value

saveInVariableName : str

variable name

SetReturnValueUnit(returnName, unit)

Sets the unit for the specified return value

This method only works with existing return values. To add a return value please use AddReturnValue()

Parameters:
returnName : str

name of the return value

unit : str

Unit to use for the ~ApiClient.PHYS representation for this return value

SetTags(tags)

Set the list of tags for this step. The list of tags will be sorted and stored.

Parameters:
tags : list[str]

The list of tags

SetTestManagementId(testManagementId)

Sets the test management id of the test step.

Parameters:
testManagementId : str

Test management id of the test step

SetTimeOptionOnlySynchronization(timeout, pollingCycle=None, timeoutUnit='ms', pollingCycleUnit='ms')

Sets the test step’s time option to “only synchronization”.

Raises:

ApiError – If no return value has an expectation, no time option can be set.

Parameters:
timeout : string

The timeout to be used

pollingCycle : string

Optional polling cycle to be used

timeoutUnit : string

Optional unit for the timeout (ms, s, min, h or d)

pollingCycleUnit : string

Optional unit for the polling cycle (ms, s, min, h or d)

SetTimeOptionPollingCycleMultiplier(pollingCycleMultiplier)

Sets the test step’s time option to “polling cycle multiplier”. This option must only be used when inserting the test step into a Multi-Check!

Parameters:
pollingCycleMultiplier : string

The polling cycle multiplier to be used.

SetTimeOptionTrueForAtLeast(minimumDuration, pollingCycle=None, minimumDurationUnit='ms', pollingCycleUnit='ms')

Sets the test step’s time option to “true for at least”.

Raises:

ApiError – If no return value has an expectation, no time option can be set.

Parameters:
minimumDuration : string

The minimum duration to be used

pollingCycle : string

Optional polling cycle to be used

minimumDurationUnit : string

Optional unit for the minimum duration (ms, s, min, h or d)

pollingCycleUnit : string

Optional unit for the polling cycle (ms, s, min, h or d)

SetTimeOptionTrueForAtLeastWithin(minimumDuration, timeout, pollingCycle=None, timeoutUnit='ms', minimumDurationUnit='ms', pollingCycleUnit='ms')

Sets the test step’s time option to “true for at least … within …”.

Raises:

ApiError – If no return value has an expectation, no time option can be set.

Parameters:
minimumDuration : string

The minimum duration to be used

timeout : string

The timeout to be used

pollingCycle : string

Optional polling cycle to be used

timeoutUnit : string

Optional unit for the timeout (ms, s, min, h or d)

minimumDurationUnit : string

Optional unit for the minimum duration (ms, s, min, h or d)

pollingCycleUnit : string

Optional unit for the polling cycle (ms, s, min, h or d)

SetTimeOptionWaitUntilTrue(timeout, pollingCycle=None, timeoutUnit='ms', pollingCycleUnit='ms')

Sets the test step’s time option to “wait until true”.

Raises:

ApiError – If no return value has an expectation, no time option can be set.

Parameters:
timeout : string

The timeout to be used

pollingCycle : string

Optional polling cycle to be used

timeoutUnit : string

Optional unit for the timeout (ms, s, min, h or d)

pollingCycleUnit : string

Optional unit for the polling cycle (ms, s, min, h or d)

SetTranslatedCommentText(comment, language)

Sets a comment for the test step in the given language.

Parameters:
comment : str

Text to be displayed

language : str

Language of the text (‘en_US’, ‘de_DE’, ‘zh_CN’)

UpdateInterface()

Updates the list of parameters and return values according to the assigned mapping target:

  • Removes any parameters and return values not available in the assigned mapping target

  • Adds any missing parameters and return values defined in the assigned mapping target. Parameters are assigned a default value. Return values are not assigned any expectation.

Parameters and return values existing in both the test step and the mapping target are left as they are, which might in some cases result in an incompatible representation or unit.

Info

This only works if the test step is associated with an appropriate mappingItem (via a package, via a global mapping, or via the ~ApiClient.mappingItem parameter of the CreateTsCall() method) and the database describing the target of the mapping item is loaded.