pyhttptest: HTTP tests over RESTful APIs✨
Pissed about writing test scripts against your RESTFul APIs anytime?
Describe an HTTP Requests test cases in a simplest and widely used format JSON within a file.
Run one command and gain a summary report.
📣
📣 Coverage measuring on Test Cases coming soon
📣
Installation
Recommended installation method is to use pip:
$ pip install pyhttptest
Python version 3+ is required.
Usage
$ pyhttptest execute FILE
See also pyhttptest --help.
Examples
Single test case
Create a .json file and define a test case like an example:
FILE: HTTP_GET.json
{
"name": "TEST: List all users",
"verb": "GET",
"endpoint": "users",
"host": "https://github.com",
"headers": {
"Accept-Language": "en-US"
},
"query_string": {
"limit": 5
}
}
Execute a test case:
$ pyhttptest execute FILE_PATH/HTTP_GET.json
Result:
Мultiple test cases
Create a .json file and define a test cases like an example:
FILE: requests.json
[
{
"name":"TEST: List all users",
"verb":"GET",
"endpoint":"api/v1/users",
"host":"http://localhost:8085/",
"headers":{
"Accept-Language":"en-US"
},
"query_string":{
"limit":1
}
},
{
"name":"TEST: Add a new user",
"verb":"POST",
"endpoint":"api/v1/users",
"host":"http://localhost:8085/",
"payload":{
"username":"pyhttptest",
"email":"admin@pyhttptest.com"
}
},
{
"name":"TEST: Modify an existing user",
"verb":"PUT",
"endpoint":"api/v1/users/XeEsscGqweEttXsgY",
"host":"http://localhost:8085/",
"payload":{
"username":"pyhttptest"
}
},
{
"name":"TEST: Delete an existing user",
"verb":"DELETE",
"endpoint":"api/v1/users/XeEsscGqweEttXsgY",
"host":"http://localhost:8085/"
}
]
Execute a test case:
$ pyhttptest execute FILE_PATH/requests.json
Result:
Dependencies
Under the hood, pyhttptest uses these amazing libraries:
ijson — Iterative JSON parser with a standard Python iterator interface
jsonschema — An implementation of JSON Schema validation for Python
Requests — Python HTTP library for humans
tabulate — Pretty-print tabular data
click — Composable command line interface toolkit
Contributing
See CONTRIBUTING.
Changelog
See CHANGELOG.
Licence
BSD-3-Clause: LICENSE.
Metadata
Release files for pyhttptest 0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyhttptest-0.7.tar.gz | 11.6 kB | Without provenance | Details for pyhttptest-0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyhttptest-0.7-py3-none-any.whl | Python 3 | none | any | Details for pyhttptest-0.7-py3-none-any.whl |
Total release size: 27.3 kB
Release files / pyhttptest-0.7.tar.gz
| Download URL | pyhttptest-0.7.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ae8620241d872cffd4c99c7ce4bfea65c1ad529eb3addf591b696c082fa997d5
|
|
BLAKE2b-256 checksum How to use checksums |
2a55c0bdc4e1dd20c76834ea21c00b4a1503e03f02e5b55a1f5b4041a9085c2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.4
|
Release files / pyhttptest-0.7-py3-none-any.whl
| Download URL | pyhttptest-0.7-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f32edcdd721cd70ca3fb499caf74e47241693f872d22b9bcfaaf7470522ac1e0
|
|
BLAKE2b-256 checksum How to use checksums |
94556ff5d9caf27eb2a4a7d3924c0140fc85829c7c65e439719e07abb60dfc56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.4
|
Security for pyhttptest 0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.