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

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

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page