Using this module you can create a API collection and it also has lots of utilities to validate the response, status code, store a value in collection variable etc.
Project description
CAKE API:
Using this module you can create a API collection and it also has lots of utilities to validate the response, status code, store a value in collection variable etc.
INSTALLATION:
pip install CakeApi
USAGE:
from CakeApi.CakeApiUtilities import CreateApiCollection
demoApiCollection = CreateApiCollection(baseUrl="https://reqres.in/")
demoApiCollection.hitTheGetRequest(url="/api/users?page=2").validateStatusCodeIs200()\
.validateTheResponseValue(expectedValue="Michael", responseDictPath="['data'][0]['first_name']")\
.hitThePostRequest(url="/api/users", data=dict(name="morpheus", job="leader")).validateStatusCodeIs201()\
.validateTheResponseValue(expectedValue="leader", responseDictPath="['job']")
Note: Refer the function comments, to get a better idea on the usage.
CONTACT:
Contact me for collabration.
LinkedIn - https://www.linkedin.com/in/krishna-kumar-859a73134
LICENSE:
© 2020 Krishna Kumar Viswanathan
This repository is licensed under the MIT license
See LICENSE for details.
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.