code_test_generate
Generate unit tests for supplied Python or JavaScript code, with support for pytest, unittest, Jest, and Mocha. Use it to turn existing functions into runnable test cases.
Instructions
为给定代码自动生成单元测试。支持pytest、unittest(Python)和Jest、Mocha(JavaScript)等测试框架。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>",
"language": "<language>"
},
"name": "code_test_generate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | 要生成测试的代码 | |
| language | Yes | 代码语言 | |
| framework | No | 测试框架(可选) |