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.1.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.1-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: apitestgen-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 b38cc2c127ab2e86734a7bf2e544a5d71625f632fdc278d1534b08b1a754d896
MD5 d15b98f2a12cc283313de682dbceb342
BLAKE2b-256 9a91e15057ce746d564260fafae3060b83be51b607e935c35ed8f79b7099496d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: apitestgen-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c61f2d23669710c70e9f4ea0fc347a2b197e9c5c7cd61a6a247892607d3d7ef
MD5 b8fb3dc0c4c341b33397346386296997
BLAKE2b-256 0ec84ff72c5f323638ae26df56ba76ae8395fe12ffce592292714280f790b14b

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