Skip to main content

Yapitest

Yapitest (Yaml API Testing) is an API testing framework composed entirely of YAML files. Testing is frustrating enough already, and Yapitest aims to simplify the entire process of API testing through a simple interface. Frankly, the entire expect(value).toBe(0) stuff keeps me up at night.

Table of Contents

Disclaimer

Yapitest is still in alpha and there may be some bugs. Feel free to open up a Pull Request or submit an issue and I will try to get it tested and merged as quickly as possible.

Example

The yapitest test format was designed to be as simple as possible. Even if you have never seen a yapitest test before, you can probably infer all of what the test is doing.

Here is an example:

test-create-and-get-post:
  setup: create-user
  steps:
    - path: /api/post/create
      id: create-post
      method: POST
      headers:
        API-Token: $setup.token
      data:
        title: Some Title
        body: Some message
      assert:
        status-code: 201
    - path: /api/post/$create-post.response.post_id
      assert:
        body:
          title: "Some Title"
          body: "Some message"
  1. Firstly, the name of the test (test-create-and-get-post) gives some indication of what the test is doing.

  2. There is a setup which is something that runs before the test. This one, create-user is reusable step that creates a user. It is defined in a config file. Similarly, you can specify a cleanup which is run after the other steps run.

  3. Then we have the steps section, which includes the actual steps of the tests.

  4. The first step sends a POST request to /api/post/create, with a title and body in the payload, utilizing an API Token that the setup generated. Then asserts that the status code is 201.

  5. The last step of the test sends a GET request to /api/post/$create-post.response.post_id. This $create-post.response.post_id referse to the json response of the $create-post step which has a key post_id in it. Then inside of the assert block we ensure that the data in the body contains the proper title and body values.

For more information about how to format your tests, please refer to Tests.md.

Installation

To install, run:

pip install yapitest

Then you can run it via yapitest in your terminal.

Further Documentation

Metadata

Release files for yapitest 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yapitest 0.0.8
File Size Uploaded Provenance
yapitest-0.0.8.tar.gz 21.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for yapitest 0.0.8
File Interpreter ABI Platform
yapitest-0.0.8-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 38.8 kB

Release files / yapitest-0.0.8.tar.gz

Download URL yapitest-0.0.8.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7ff0b354fca4113a72628caeeb87df159d4fba0f43be7c9edf76178400b27ba5
BLAKE2b-256 checksum
How to use checksums
4caf97a6838dfb74954f6bf9d90d1724a468338e559f4b0fef954106b932cb99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.5

Release files / yapitest-0.0.8-py2.py3-none-any.whl

Download URL yapitest-0.0.8-py2.py3-none-any.whl
Size 17.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
72cdb9a022b4c41f9da6b2c472b1b85cf383758926894cbfac6cece12aa2024b
BLAKE2b-256 checksum
How to use checksums
3821966cd006a43ddd72208828b0e5afe4d7332fd7e12e1578a9e8c8b13917da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.5

Security for yapitest 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page