Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

commonsApi-1.0.3-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file commonsApi-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: commonsApi-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for commonsApi-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 43c51de65ef96e0c607b3d473a509fc05b51e149861b04a8db7a0a28921808ca
MD5 d961c4cdc4241611b1a082acbcacf771
BLAKE2b-256 138478b9f3d9d5e1164df307bf2f56ffa2aa83925717616e19f1b3065156bbf9

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