API Library
Project description
CAFE-API
CAFEX-API is a Python package that provides tools and utilities for API testing. It is part of the CAFE (Core Automation Framework Enhancements) monorepo.
Features
CAFEX-API offers the following features:
- Request building: Simplifies the creation of API requests with various methods and parameters.
- Response parsing: Provides methods to parse JSON and XML responses and extract relevant data.
- Assertions: Includes assertion methods specifically designed for API testing, allowing for efficient validation of response data.
- Data-driven testing: Supports data-driven testing approaches to execute tests with different data sets.
- Reporting: Integrates with CAFE's reporting capabilities to generate comprehensive test reports.
Getting Started
Prerequisites
- Python 3.12 or later
- pip (Python package manager)
Installation
-
Install CAFEX-API using pip:
pip install cafex-api
Usage
CAFE-API provides a set of intuitive methods and classes to facilitate API testing. Here's a basic example:
from cafex_api import request_builder
from cafex_api import response_parser_json
# Build an API request
request = request_builder.RequestBuilder().get(url="https://api.example.com/users")
# Send the request and get the response
response = request.send()
# Parse the JSON response
parsed_response = response_parser_json.ParseJsonData().get_dict(response.text)
# Validate the response data
assert parsed_response["status"] == "success"
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
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
cafex_api-1.0.0-py3-none-any.whl
(20.2 kB
view details)
File details
Details for the file cafex_api-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cafex_api-1.0.0-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a9c3e23ebd42da272f7d6b78ceaa55ee4d2b8bf159f84de769bbf63d2c47c6e
|
|
| MD5 |
ef0e197e5d5f294072cf1d322c8cc2b4
|
|
| BLAKE2b-256 |
f7e2b648c78f9d167351014c32e32934d51fd00d39a15ea3006ae3fa8fcdeb0d
|