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.2.tar.gz (23.4 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.2-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: apitestgen-1.0.2.tar.gz
  • Upload date:
  • Size: 23.4 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.2.tar.gz
Algorithm Hash digest
SHA256 8d0c4e7a27d62ddc34cf9ddb8470123215357950185f537fedae9a211e610190
MD5 8dd0d920593dedb95bd5da5011b75af3
BLAKE2b-256 67151f6f3a6c1c3301d815a0c17ecf140285ac54729ff2d420394ce1756d3ec2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: apitestgen-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4708d7db51643d68b328aef8f81f7fb6f5156c9bb678e4bda8dce44ccf55c899
MD5 1f27ba5aa8a0c2c7667da01386d613ae
BLAKE2b-256 f2d814571cb955adc179c56c84c4922d1b726fb2caee436f6d6deda24ee8e6ee

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