polyspace.project.OwnedTestCase Class
Namespace: polyspace.project
Description
This Python® class contains information about a graphical test case that is part of a
specific Polyspace® Platform project and can only be accessed via the corresponding project object.
Owned test cases are saved in the .psprjx project file and are not
accessible from other projects. You can author this test case by using the Polyspace
Python API or the Polyspace Platform user interface.
To create modular projects, where project components like configurations and graphical
tests are saved in separate files, consider using test references. A test
reference is a graphical test case that is saved in a separate
.pstestd file that is referenced by the project. To work with test
references in the Polyspace
Python API see polyspace.project.TestCaseRef and polyspace.project.TestCase. For more information about project structure, see Modularize Project by Using External Configurations, Test References, and External Stub Files.
Creation
Syntax
Description
Create Test Case
testCase = testSuite.TestCases.create(
creates an empty testName)polyspace.project.OwnedTestCase object
testCase in the test suite testSuite of a
project. The Name property of the resulting
polyspace.project.OwnedTestCase object is testName.
For more information on the polyspace.project.TestSuite object and
its methods, see the description of the TestSuites
property of the polyspace.project.Project class.
Load Test Case
loads the existing testCase = testSuite.TestCases[testName]polyspace.project.OwnedTestCase object with
Name property set to testName from the test
suite testSuite of a project.
Create Copy of Test Case
testCase = testSuite.TestCases.createFrom(
creates a new ownedTestCaseObj, testName)polyspace.project.OwnedTestCase object
testCase in the test suite testSuite by copying
an existing polyspace.project.OwnedTestCase object. Use the
testName argument to set the Name property of
the resulting polyspace.project.OwnedTestCase object.
testCase = testSuite.TestCases.createFrom(
creates a new existingTestFile)polyspace.project.OwnedTestCase object
testCase in the test suite testSuite by copying
the test case from existingTestFile.pstestd.
testCase = testSuite.TestCases.createFrom(
creates a new existingTestFile, testName)polyspace.project.OwnedTestCase object
testCase in the test suite testSuite by copying
the test case from existingTestFile.pstestd. Use the
testName argument to set the Name property of
the resulting polyspace.project.OwnedTestCase object.
Convert Test Case
testCase = testSuite.TestCases.moveAsOwned(
converts the test case referenced by existingTestCaseRefObj)existingTestCaseRefObj in
testSuite to a polyspace.project.OwnedTestCase
object in the same test suite. The conversion removes the
existingTestCaseRefObj from the test suite.
Input Arguments
Properties
Methods
Version History
Introduced in R2026aSee Also
polyspace.project.CodeInfo | polyspace.project.Project | polyspace.project.TestCase | polyspace.project.TestCaseRef | polyspace.project.ScriptedTestStep | polyspace.project.TabularTestStep
Topics
- Author Graphical Tests Using Python API for Polyspace
- Create Easily Shareable Projects for Version Control
- Modularize Project by Using External Configurations, Test References, and External Stub Files
- Modularize Existing Project by Using Polyspace Python API
- Create Project Dynamically by Using Polyspace Python API