Skip to main content

A web API verification tool.

Project description

Preacher: Web API Verification Valuing Automation and Reality

PyPI version Documentation Status CircleCI Codecov Language grade: Python

Preacher verifies API servers, which requests to the servers and verify the responses along to given scenarios.

Scenarios are written in YAML, bodies are analyzed jq or XPath queries and validation rules are based on Hamcrest (PyHamcrest) so that any developers can write without learning toughly.

The full documentation is available at preacher.readthedocs.io.

Targets

  • Flexible validation to test with real backends: neither mocks nor sandboxes.
    • Matcher-based validation.
  • CI Friendly to automate easily.
    • A CLI application and YAML-based scenarios.

Usage

First, install Preacher.

The most basic way to install Preacher is using pip. Supports only Python 3.7+.

$ pip install preacher
$ preacher-cli --version

Instead of pip, Docker images are also available on Docker Hub as ymoch/preacher. By default, the container working directory is /work, and the host directory may be mounted here.

$ docker pull ymock/preacher
$ docker run -v $PWD:/work ymoch/preacher preacher-cli --version

Second, write your own scenario.

# scenario.yml
label: An example of a scenario
cases:
  - label: An example of a case
    request: /path/to/foo
    response:
      status_code: 200
      body:
        - describe: .foo
          should:
            equal: bar

Then, run preacher-cli command.

$ preacher-cli -u http://your.domain.com/base scenario.yml

For more information such as grammer of scenarios, see the full documentation.

License

MIT License

Copyright (c) 2019 Yu MOCHIZUKI

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

preacher-0.11.4.tar.gz (22.6 kB view hashes)

Uploaded Source

Built Distribution

preacher-0.11.4-py3-none-any.whl (34.9 kB view hashes)

Uploaded Python 3

Supported by

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