Skip to main content

智能测试数据生成器 - 支持 JSON Schema / OpenAPI 的正向和负向测试用例生成

Project description

apitestgen

智能 API 测试数据生成器,支持 JSON Schema / OpenAPI 的正向和负向测试用例生成。

安装

pip install apitestgen

##快速开始

from apitestgen.formats import create_generator

schema = { "type": "object", "required": ["name", "age"], "properties": { "name": {"type": "string", "minLength": 2, "maxLength": 10}, "age": {"type": "integer", "minimum": 0, "maximum": 150} } }

gen = create_generator(schema)

正向生成

print(gen.generate())

多场景

for v in gen.generates(): print(v["label"], v["data"])

负向测试

for case in gen.generate_negative(): print(case.sub_case_id, case.data)

特性

正向单次/多场景数据生成

负向测试用例生成(边界值、类型错误、枚举违反等)

Schema 校验

组合策略(single/pairwise/combinatorial)

支持 JSON Schema 和 OpenAPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apitestgen-1.0.0-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

Details for the file apitestgen-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: apitestgen-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 36.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for apitestgen-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 548229588e5423f770c041b2fb4557b44cd523f4193841add19f12e3b1d7fc59
MD5 3d04bdbc563a0691d5edd5054813a987
BLAKE2b-256 27628250c367a86f5baffa910785ced5e79a68b20e92e152ab43d9cdf539dddf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page