Skip to main content

xiaobaiapi 让接口测试起来更简单、人性化、更好玩 公众号:小白科技之窗

Project description

xiaobaiapi

介绍

让接口测试起来更简单、人性化、更好玩
公众号:小白科技之窗

接口测试需要接口的痛点:

  • 接口文档的导入:swagger、har、curl
  • 接口信息头:支持长字符串
  • 接口断言:支持jsonpath与正则断言
  • 接口数据:支持jsonpath提取数据

软件架构

python3.* + requests + jmespath + pytest + pytest-HTML

安装教程

  • 更新下载源 pip config set global.index-url https://pypi.douban.com/simple

  • 安装xiaobaiapi pip install -U xiaobaiapi

使用说明

from xiaobaiapi.xiaobaiapi import RequestClient


# 断言的案例
RequestClient(method='GET', url='http://127.0.0.1:8000', assertExpression='code', assertValue=200)

# 提取器的案例,提取的值存储在r.variable对象中
r = RequestClient(method='GET', url='http://127.0.0.1:8000/api/gettoken', extractorExpression='data.token', extractorVariable='token')
print(r.variable)

日志

版本 信息
0.1 完成单个接口断言及提取器
0.1.1 fix

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

xiaobaiapi-0.1.1.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

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

xiaobaiapi-0.1.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file xiaobaiapi-0.1.1.tar.gz.

File metadata

  • Download URL: xiaobaiapi-0.1.1.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for xiaobaiapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6cd4f6094d25061dd38f2133ad73a24af76cfbb979ea1458049be43480794213
MD5 6abfdb96a00f36cd3dc4b5154dc7f385
BLAKE2b-256 83b265f0683827fff7b465d50ec285204304ae5a81d33fc8be79399cd339ade2

See more details on using hashes here.

File details

Details for the file xiaobaiapi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: xiaobaiapi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for xiaobaiapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d25f4a98bd4c7ab621891fedfc14cfce83240401b02fabc0466653ee66fa333
MD5 e32a88922554616c510c71dbf67f4180
BLAKE2b-256 db53b997c742a73cce065470b04c98e8baeb30678859e8bf4a85d6f490eff2b8

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