VectorSingleExpectation

class VectorSingleExpectation

Represents a sparse vector of expectations. Each element of the vector represents an individual expectation on the respective value. All individual expectations must be fulfilled in order for the this vector expectation to be fulfilled.

Each individual expectation is specified as a Boolean expression in Python syntax. The special identifier “value” refers to the actual value of the vector element.

Returned by

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:

VectorSingleExpectation

GetDimension()

Returns the dimension of the element.

Returns:

Dimension of the element.

Return type:

int

GetExpectation(index)

Returns the expectation object for the specified element.

Parameters:
index : int

Index of the expectation object.

Returns:

The expectation object

Return type:

Expectation

GetExpectationExpression(index)

Returns the expectation expression for the specified element.

Parameters:
index : int

Index of the expression.

Returns:

The expression

Return type:

str

GetExpectationExpressions()

Returns a list of all expectation expression. Elements without expectation are represented by None

Returns:

Sorted list containing all expectation expressions

Return type:

list[str]

RemoveExpectation(index)

Removes the expectation expression for the specified element.

Parameters:
index : int

Index of the expression to remove.

SetExpectation(index, expectationObject)

Sets the expectation object for the specified element.

Parameters:
index : int

Index of the expectation object.

expectationObject

The expectation object

SetExpectationExpression(index, expression)

Sets the expectation expression for the specified element.

Parameters:
index : int

Index of the expression.

expression : str

The expression