GithubHelp home page GithubHelp logo

svp's Introduction

SVP - A Python-based API testing microframework

Open in Gitpod CircleCI

Automating testing is no easy task. Luckily, we're here to help - with API testing. All you need to do is ask.

Why a microframework?

The goal of this project is to be as lightweight as possible and make use of common Python approaches and libraries. We depend on requests to do most of the actual API-level work, and endeavour to only have a small number of files that could be copied into projects if needed.

Installation

The latest version of SVP can be installed via pip

pip install svp

or this repository can be cloned and SVP can be installed directly

python setup.py install

Usage

The goal of SVP is to provide lightweight help to get an API testing framework up and running. The main component of the project is the API class, which is designed to be subclassed. This provides all the basic functionality needed to wrap the API under test into neat methods, including the usual GET, POST, PUT, PATCH and DELETE verbs for HTTP requests.

Each API instance methods return an APIResponse, which is a wrapper class around a request response. APIResponses allow for neat and tidy testing since they are dictionaries, so assertions can look like this:

response = api.get_account_details('id#123')

assert response['accountName'] == 'Josh'

Instead of raising an error if particular fields aren't present, APIResponse simply returns None if the key doesn't exist. Also provided are constructs such as status code, content and headers, also easily accessible in a dict-like format.

Also provided are some APIAssert utility functions to make assertions a bit easier for routine checking such as if status codes are 200- or 400-level codes.

Please - I need help

This is a lightweight project that is also early in its development. Please post an issue if you'd like some help or find me on Twitter if you'd like.

Additional Resources

svp's People

Contributors

joshmgrant avatar

Watchers

 avatar  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.