Skip to content

openeduhub/auto-openapi-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-openapi-tests

Automatically test web-services with OpenAPI specifications, utilizing pytest and hypothesis.

When run, a series of tests will be automatically generated and run based on the OpenAPI specification of the given web-service. If a test fails, hypothesis will find and return a minimal example that causes the found issue.

Currently, the following is implemented:

  • Check, whether the specification is a valid OpenAPI specification, using openapi-spec-validator
  • Parse the specification and automatically generate tests according to the input types of each end-point. This test is considered to fail when the response code is different from 200. For this, the following types are supported:
    • enum
    • string (i.e. text), with minimum / maximum length
    • number, with minimum / maximum value (optionally exclusive)
    • boolean

Usage

With Nix

To run the tests on any running web-service, use

nix run github:openeduhub/auto-openapi-tests -- --api "http://<web-service>" --spec-loc "<openapi-json-endpoint>"

See nix run github:openeduhub/auto-openapi-tests -- --help for more information on possible command line arguments.

Installed through pip

Clone this repository, then install the application with

pip install <path/to/repository>

Now, the application can be run through

auto-openapi-tests --api "http://<web-service>" --spec-loc "<openapi-json-endpoint>"

About

An automatic testing suite for OpenAPI services

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published