This is a package to automate apis in a simple way by using common reusable functions
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for commonsApi-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43c51de65ef96e0c607b3d473a509fc05b51e149861b04a8db7a0a28921808ca |
|
MD5 | d961c4cdc4241611b1a082acbcacf771 |
|
BLAKE2b-256 | 138478b9f3d9d5e1164df307bf2f56ffa2aa83925717616e19f1b3065156bbf9 |