Metadata-Version: 2.0
Name: responses-proxy
Version: 0.1.2
Summary: allow you to easily mock HTTP responses in your tests
Home-page: https://github.com/bearstech/responses_proxy
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Keywords: requests responses
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Testing
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Requires-Dist: requests
Requires-Dist: responses
Requires-Dist: waitress
Requires-Dist: webob
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'

===================
responses proxy
===================

.. image:: https://travis-ci.org/bearstech/responses_proxy.png?branch=master
  :target: https://travis-ci.org/bearstech/responses_proxy

responses_proxy allow you to easily mock HTTP responses in your tests

Installation
=============

::

    $ pip install responses_proxy

Usage
=====

Check command line arguments::

    $ responses-proxy -h

First save some stuff using the proxy mode::

    $ responses-proxy --proxy

If your target site use ssl then use::

    $ responses-proxy --proxy --use-ssl

The proxy do not support ssl so you need to make http request. But first set
the `HTTP_PROXY` env var::

    $ export HTTP_PROXY=http://localhost:3333

Then run some code to make some requests::

    python -c "import requests; requests.get('http://bearstech.com')"

This will generate some file in `tests/responses/`

You can now restart the server without the proxy mode and the client will react
the same way without calling the real server.

You can aslo use a `RequestsMock` in you unit tests::

    import responses_proxy
    import requsests

    def test_url():
        with responses_proxy.RequestsMock():
            requests.get('http://bearstech.com')
            # https will work to. both are registered
            requests.get('https://bearstech.com')


