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 Distribution

apitestgen-1.0.3.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

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

apitestgen-1.0.3-py3-none-any.whl (37.0 kB view details)

Uploaded Python 3

File details

Details for the file apitestgen-1.0.3.tar.gz.

File metadata

  • Download URL: apitestgen-1.0.3.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for apitestgen-1.0.3.tar.gz
Algorithm Hash digest
SHA256 a6482ddf11dd1e83b256334689023f3a0b684e981ec43e899a13d008e1fcbe27
MD5 413e0d26d416ef85d081a6f9f17b370c
BLAKE2b-256 872d2913ac9c3b625d594f7a7c3337c3021383f69629fc0642ae964cf0252bb0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: apitestgen-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 37.0 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 abd1008934bfc1184829afc729d829b7aaa199b603dd06886ff69b0c21ccea18
MD5 4b2c91d30a225be3e33016829b941753
BLAKE2b-256 dc29d9dd19f279d6d6ea4cf4beaf86d0002474d2909042b028d3dcf2fb6ca967

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