A streamlined Python library for crafting HTTP requests and testing API
Project description
ReqFlow
ReqFlow is a Python library designed for efficient and intuitive API testing. ReqFlow offers a fluent and flexible interface for crafting and validating HTTP requests, making API testing both straightforward and adaptable. While it make sense to use standard approaches for a Python API testing, ReqFlow reduces the entry barrier for beginners and allows for more advanced use cases with RestAssured-like approach.
Features
- Fluent API for building and sending HTTP requests.
- Supports response handling and validations.
- Customizable response validation using
PyDantic
models. - Convenient utility methods for common assertions and response manipulations.
The tool is still in development, braking changes are possible. Any feedback and contributions are highly appreciated.
Installation
Install ReqFlow using pip
:
pip install reqflow
Quick Start
from reqflow import given, Client
from pydantic import BaseModel
# Define a Pydantic model for response validation
class ExampleModel(BaseModel):
name: str
value: int
# Initialize the client
client = Client(base_url="https://api.example.com")
# Use ReqFlow's fluent API
response = (given(client)
.header("Authorization", "Bearer TOKEN_VALUE")
.query_param("param", "value")
.when("GET", "/your_endpoint")
.then()
.validate_data(ExampleModel)
.status_code(200)
.get_content())
print(response)
Documentation
Detailed documentation can be found at reqflow.org
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 Distribution
Built Distribution
Hashes for ReqFlow-1.0.5a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c0feb61bc312f96862b7ae094ff836c9390c2b231e0ca091d1f66648b38ba97 |
|
MD5 | 1354ec52592deecb1ae63821dc170e78 |
|
BLAKE2b-256 | f5a6adb9d2c5f5d2c16c541d8839c0b790a17d435c6733be45b7a48fb0149e5a |