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.4.tar.gz (24.0 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.4-py3-none-any.whl (37.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: apitestgen-1.0.4.tar.gz
  • Upload date:
  • Size: 24.0 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.4.tar.gz
Algorithm Hash digest
SHA256 3cc859f646bdef13f3bf189c81b9ff0c30ca64f73c46e9df345094ec31033250
MD5 fe7ada0e33d6d628ef249add9c21f762
BLAKE2b-256 5d67c2433c2cc62dd3f9b870b748c9627b67e97517099b08d4df7507ea06e8ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: apitestgen-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 37.4 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e502a36454a0c091439eb2002a8dd02fe4bfc2f73eda3a191e29be7db63213b8
MD5 5a449bee77deeb1ca7ed20b28b892c0f
BLAKE2b-256 b92d1e6a5a141417b791d48254df8daf52850fd188a59f4d6fe5ee5353becf01

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