Coder Social home page Coder Social logo

postpython's Introduction

Postpython

Postpython is a library for Postman that run postman's collections. If you are using postman, but collection runner is not flexible enough for you and postman codegen is too boring, Postpython is here for your continuous integration.

Why use Postpython instead of postman codegen?

  • Postman codegen should be applied one by one for each request and it's boring when your api changes, but with postpython you don't need to generate code. Just export collection with postman and use it with Postpython.
  • In code generation you don't have environment feature any more and variables are hardcoded.

Why user Postpython instead of Postman collection runner?

  • With postpython you write your own script. But collection runner just tun all your requests one by one. So with Postpython you can design more complex test suites.

How to use?

Import PostPythonCollection

from postpython import PostPythonCollection

Make an instance from PostPythonCollection and give address of postman collection file.

runner = PostPythonCollection('/path/to/collection/Postman echo.postman_collection')

Now you can call your request. Folders' name change to upper camel case and requests' name change to lowercase form. In this example the name of folder is "Request Methods" and it's change to RequestMethods and the name of request was "GET Request" and it's change to get_request. So you should call a function like runner.YourFolderName.you_request_name()

response = runner.RequestMethods.get_request()
print(response.json())
print(response.status_code)

Variable assignment

In Postpython you can assign values to environment variables in runtime.

runner.environment.update({'BASE_URL': 'http://127.0.0.1:5000'})
runner.environment.update({'PASSWORD': 'test', 'EMAIL': '[email protected]'})

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.