API Testing Commons
-
This is a package to automate apis in a simple way by using common reusable functions.
-
This module containes the major reusable functions which can be imported and accessed directly which will reduce the time and code redundancy.
Installation
pip install commonsApi
Methods available
-
get_api(endpoint, header)
-
post_api(endpoint, request_payload, header)
-
put_api(endpoint, request_payload, header)
-
delete_api(endpoint, data, header)
-
patch_api(endpoint, request_payload, header)
-
validate_status_code(response, expected_status)
-
validate_schema(response, expected_schema)
-
validate_strings(actual_message, expected_message)
-
value_present(response, expected_value)
-
is_json(response)
Sample code
import commonsApi
url = "https://api.postcodes.io/random/postcodes"
header = {}
resp = commonsApi.get_api(url, header)
print(resp.json())
Raise if any issues/changes needed
Please raise an issue here if anything
Metadata
Release files for commonsApi 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| commonsApi-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Release files / commonsApi-1.0.3-py3-none-any.whl
| Download URL | commonsApi-1.0.3-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43c51de65ef96e0c607b3d473a509fc05b51e149861b04a8db7a0a28921808ca
|
|
BLAKE2b-256 checksum How to use checksums |
138478b9f3d9d5e1164df307bf2f56ffa2aa83925717616e19f1b3065156bbf9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.0
|