Test cases - Create multiple
- TypeScript
- Python
Create multiple test cases with createTestCases()
.
Create multiple test cases with create_test_cases()
.
Example
typescript
constcreationCount = awaitcreateTestCases ({pipelineSlug : 'example-pipeline',datasetId : '550e8400-e29b-41d4-a716-446655440000',testCases : [{name : `TC 1`,inputs : {a : 1,b : 2 },expectedOutputs : {c : 3 },},],});console .log ('Created test case count: ',creationCount );
python
import osimport gentracegentrace.init(api_key=os.getenv("GENTRACE_API_KEY"))creation_count = gentrace.create_test_cases(pipeline_slug="example-pipeline",dataset_id="550e8400-e29b-41d4-a716-446655440000",payload=[{"name": "Batman -> Black Window #1","inputs": {"query": "describing an ethical dilemma you encountered and asking "+ "for feedback","sender": "Batman","receiver": "Black Widow",},"expectedOutputs": {"value": "Dear Natasha,\n I have run into a problem..."},},{"name": "Superman -> Wonder Woman #3","inputs": {"query": "desperately asking for backup to a tough situation you am"+ " in","sender": "Superman","receiver": "Wonder Woman",},"expectedOutputs": {"value": "Subject: Urgent Assistance Required: Backup Needed"+ " Immediately"},},],)print(creation_count)
Arguments
payload: CreateMultipleTestCase
Note: Either datasetId
or pipelineSlug
can be specified in the payload. If both are provided, datasetId
will be prioritized.
These are the possible keyword arguments.
pipeline_slug: Optional[str]
dataset_id: Optional[str]
test_case_payloads: List[CreateMultipleTestCasesTestCasesInner]
Note: Either dataset_id
or pipeline_slug
can be specified. If both are provided, dataset_id
will be prioritized.
Types
🛠️ CreateMultipleTestCasesTestCasesInner
This type defines the structure for creating a single test case.
name?: string
inputs?: object
expectedOutputs?: object
Return value
creationCount: number
The number of test cases created as a number.
creation_count: int
The number of test cases created as a number.