NumericExpectation

class NumericExpectation

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:

NumericExpectation

DeactivateTolerance()

Deactivates the tolerance for this expectation.

GetDontEvalNotPresent()

Returns whether the option to evaluate this expectation if the expected value is NotPresent is set or not.

Returns:

True if the described behavior is enabled otherwise False.

Return type:

boolean

GetExpression()

Returns the expectations expression.

Returns:

The expression

Return type:

str

GetRelation()

Returns the relation for this expectation.

Returns:

The relation

Return type:

str

GetToleranceType()

Returns the type of the set tolerance. Returns ‘absolute-value’, ‘percentage’, ‘decimal-places’, or ‘none’.

Returns:

The type of the tolerence

Return type:

str

GetToleranceValue()

Returns the expression for the tolerance or None if the tolerance type is ‘none’.

Returns:

The expression for the tolerance

Return type:

str

SetDontEvalNotPresent(dontEvalNotPresent)

Enables or disables the option to evaluate this expectation if the expected value is NotPresent.

Parameters:
dontEvalNotPresent : boolean

True to enable the described behavior. False to disable it.

SetExpression(expression)

Sets the expectations expression.

Parameters:
expression : str

The expression

SetRelation(relation)
Sets the relation for this expectation. Allowed values are:
  • ‘<’

  • ‘<=’

  • ‘==’

  • ‘>=’

  • ‘>’

  • ‘!=’

  • ‘<>’ (results in ‘!=’)

Parameters:
relation : str

The relation

SetTolerance(toleranceType, toleranceExpr)

Sets the type and value of the tolerance for this expectation.

Parameters:
toleranceType : str

Possible types are: - ‘absolute-value’ - ‘percentage’ - ‘decimal-places’

toleranceExpr : str

The expression for the tolerance