Skip to content

kanghyojun/flask-httpretty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages