Skip to main content

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)

Watch the video

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

  1. Getting Started

  2. Test Structure

  3. Making Requests

  4. Testing Responses

  5. Variables and Data

  6. Advanced Features

  7. Integration and Export

  8. Command Line Options

APPENDIX A - Test Modes Reference

APPENDIX B - Path Parser

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

restest-2.4.0.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

restest-2.4.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file restest-2.4.0.tar.gz.

File metadata

  • Download URL: restest-2.4.0.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for restest-2.4.0.tar.gz
Algorithm Hash digest
SHA256 c6392424b2773a05ea24209d7adb88c56ab127a4ce0965c38657b95b82d55a70
MD5 5e6993eabdea660202836fd2915746d2
BLAKE2b-256 b6edd57074dfec2c01e232e11fb1371ee93908eaa2f0540abb118fe72d7a5313

See more details on using hashes here.

File details

Details for the file restest-2.4.0-py3-none-any.whl.

File metadata

  • Download URL: restest-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for restest-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7345ddd48aca5a1a9a9149e1f4720bc0cc59ba5a5816adf3f6daab41a439d89
MD5 68623d2214462f02ce8ca17803622963
BLAKE2b-256 35b42ba70c9b32088249e50e6fb0b4aba1f75951fe96e48d81111187aa347b1a

See more details on using hashes here.

Supported by

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