polyspace.project.CallSequenceAssessment Class
R2026bNamespace: polyspace.project
(Python) Access and configure function call sequence assessment for test step
Since R2026b
Description
This Python® class represents a function call sequence assessment for a test step. A call sequence assessment verifies that your code under test calls specific functions in a defined order during test execution. For each function in the sequence, you can optionally enable assessments for the input parameters passed to that function.
Each test step, whether tabular or scripted, can have one call sequence assessment. Use
the CallSequenceAssessment property of a polyspace.project.TabularTestStep or polyspace.project.ScriptedTestStep object to access this class.
A function call sequence assessment fails when:
The functions are not called in the expected order.
One or more of the input parameter assessments fail.
Note
Function call sequences are strict. Once you include a function in the call sequence, the assessment checks for all calls to that function. If the function is called before, after, or in between the expected calls you specify, the call sequence assessment fails.
Creation
Syntax
Description
callSeq = step.CallSequenceAssessment returns the
CallSequenceAssessment object for a polyspace.project.TabularTestStep or polyspace.project.ScriptedTestStep object step. Each test
step has exactly one CallSequenceAssessment object. You do not create
this object directly. Instead, you access it from the test step and add function calls to
it.
funcCall = step.CallSequenceAssessment.FunctionCalls.create(
creates a Fcn)FunctionCallAssessment object and appends it to the end of
the call sequence for the test step step. The argument
Fcn is a polyspace.project.Function object obtained from parsing your source code. The
order in which you create function calls defines the expected call order. Adding a
function to the call sequence also creates assessments for all inputs to that function,
but these input parameter assessments are disabled by default. For more information, see
the FunctionCalls
property.
Input Arguments
Properties
Examples
Limitations
To add a function to a call sequence, the function must be supported for mocking. For more information, see Identify Why Function Is Not Supported for Mocking.
Version History
Introduced in R2026b