httpstatuspuppet

A HTTP server that will return a status code of your choice


Keywords
http, python, status, testing, tool
License
MIT
Install
pip install httpstatuspuppet==1.0.0

Documentation

Build Status codecov PyPI version

HTTP Status Puppet

A HTTP server that will return a status code of your choice

Introduction

This server simply returns back a status code depending on what endpoint is contacted, e.g.

$ curl -s -o /dev/null -w "%{http_code}" http://0.0.0.0:8000/403
403
$ curl -s -o /dev/null -w "%{http_code}" http://0.0.0.0:8000/200
200

Installation

Prerequisites

  • Python 3.6+

The tool can be installed from PyPi:

pip install httpstatuspuppet

Bleeding edge versions can be installed directly from GitHub:

pip install git+https://github.com/wtsi-hgi/http-status-puppet/.git@master#egg=httpstatuspuppet

Usage

Warning: this server was only designed for use in testing!

Local

After installing dependencies, in the project directory:

PYTHONPATH=. python httpstatuspuppet/entrypoint.py

Docker

docker run -d -p ${HOST_PORT}:8000 mercury/http-status-puppet

Alternatives