Scriptable REST calls test software written in Python
Project description
RESTest Documentation
RESTest is a powerful and flexible REST API testing tool written in Python that allows you to create, run and validate API tests through simple JSON files. With RESTest, you can quickly set up test suites for your APIs, validate responses, extract and reuse data between requests, and much more.
WATCH my PyCon IT 2023 presentation (in Italian)
Key Features
- Simple JSON-based Test Definition: Write tests using straightforward JSON syntax
- Session Management: Automatic handling of cookies and authentication tokens
- Variable Storage and Reuse: Extract data from responses and use them in subsequent requests
- Powerful Path Parser: Extract and validate nested JSON values with ease
- Request Authentication: Built-in support for Bearer token authentication
- Comprehensive Testing: Validate response status codes, headers, and body content
- Test Organization: Group tests into logical sections
- Test Chaining: Use data from previous responses in subsequent requests
- Export Capabilities: Generate Postman collections from your tests
- Detailed Logging: Keep track of all requests and responses
- Performance Metrics: Monitor request timing and response sizes
Quick Start
Installation
Install RESTest using pip:
pip install restest
Basic Usage
Create a simple test file (e.g., test.json
):
{
"system": {
"base_url": "https://api.example.com",
"log_file": "./restest.log"
},
"actions": [
{
"method": "get",
"url": "/users/1",
"tests": [
{
"field": "id",
"value": 1
}
]
}
]
}
Run the test:
restest test.json
Documentation Chapters
APPENDIX A - Test Modes Reference
Contributing
RESTest is an open-source project and welcomes contributions. Visit the GitHub repository to:
- Report issues
- Submit pull requests
- Suggest new features
- Help improve documentation
License
RESTest is released under the GPLv3 License. See the LICENSE file in the project repository for more 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.
Source Distribution
Built Distribution
File details
Details for the file restest-2.3.0.tar.gz
.
File metadata
- Download URL: restest-2.3.0.tar.gz
- Upload date:
- Size: 29.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73fe9d888966d8eba3ec2b072f542194cec7859cae0fe535345e2b7845995007 |
|
MD5 | 24ccab3aa0f21013f1403c38be28fb52 |
|
BLAKE2b-256 | 2ee9591474d3c8baa90f878133e928bed54e1f454bb057e75168e8b2c51f54a6 |
File details
Details for the file restest-2.3.0-py3-none-any.whl
.
File metadata
- Download URL: restest-2.3.0-py3-none-any.whl
- Upload date:
- Size: 30.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b911474f5ce02ff696edae138128dd6230d41fbf1af7327d999b952050fa7ba |
|
MD5 | 1ff3c2f8fb81061252aa44ed47944d4e |
|
BLAKE2b-256 | c5fa3895316e920ad0a3e660293245098910c3cea67694d8e843119cc9b72ea6 |