Skip to main content

Flask-httpretty

https://travis-ci.org/admire93/flask-httpretty.svg?branch=master

Mock http request with flask!

flask-httpretty is built based on httpretty.

Hello world

from flask import Flask
from urllib.request import urlopen

import flask_httpretty


app = Flask(__name__)


@app.route('/', methods=['GET'])
def hello_world():
    return 'hello world'


@flask_httpretty.activate
def test_hello_world():
    flask_httpretty.register_app(app, 'http://hellotest.com')
    resp = urlopen('http://hellotest.com').read()
    assert 'hello world' == resp.decode('utf-8')

Officially supported libraries

Since flask-httpretty use httpretty to monkey patches pythons’socket, it support same libraries httpretty do. these are

Metadata

Release files for Flask-httpretty 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-httpretty 1.3.0
File Size Uploaded
Flask-httpretty-1.3.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Flask-httpretty 1.3.0
File Interpreter ABI Platform
Flask_httpretty-1.3.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 11.6 kB

Release files / Flask-httpretty-1.3.0.tar.gz

Download URL Flask-httpretty-1.3.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b5192a638aeacf07d0ef6b91a0ba4ee66146b4f5c4037bd8a07fa3fae0b13edb
BLAKE2b-256 checksum
How to use checksums
f3de2ec2ea4fff084483afa3597cae7fdd8eb201efbb4ac3dd5bff4aeff591db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Flask_httpretty-1.3.0-py2.py3-none-any.whl

Download URL Flask_httpretty-1.3.0-py2.py3-none-any.whl
Size 7.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5a5a3abe3c14390cfb9a7858381090b483b473b3d156b971aab6677816e7a533
BLAKE2b-256 checksum
How to use checksums
913d101d2c3ea72163f69084a8a763438d0080c84afa7f9eff181e8a3cad027d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page