Git Product home page Git Product logo

swagger-tester's Introduction

Travis status

Join the chat at https://gitter.im/Trax-air/swagger-tester

image

swagger-tester

Swagger-tester will test automatically your swagger API. Swagger API made with connexion (https://github.com/zalando/connexion) are supported directly without running the API server. In the case you use connexion it will automatically run a test server from your swagger file.

To run the test, swagger-tester will detect every path and actions of your API. And for each, it will send a request and check if the response match the swagger file specification.

You may find related libraries to this one:

Example Usage

from swagger_tester import swagger_test

 # Dict containing the error you don't want to raise.
 # By default, every status_code over other than 1xx, 2xx or 3xx
 # will be considered as an error.
 authorize_error = {
       'post': {
           '/pet/{petId}': [200],
           '/pet': [200]
       },
       'put': {
           '/user/{username}': [200],
           '/pet': [200]
       },
       'delete': {
           '/pet/{petId}': [200],
           '/store/order/{orderId}': [200],
           '/user/{username}': [200]
       }
   }

 # Run the test with connexion
 # An AssertionError will be raise in case of error.
 swagger_test('path_to_your_swagger.yaml', authorize_error=authorize_error)

 # Or if you have a running API
 swagger_test(app_url='http://petstore.swagger.io/v2', authorize_error=authorize_error)

Documentation

More documentation is available at https://swagger-tester.readthedocs.org/en/latest/.

Setup

make install or pip install swagger-tester

License

swagger-tester is licensed under http://opensource.org/licenses/MIT.

swagger-tester's People

Contributors

cyprieng avatar jfinkhaeuser avatar victorpoluceno avatar thomashickman avatar beanqueen avatar quantifiedcode-bot avatar cyprien-g avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.