Skip to main content

responses proxy

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

responses_proxy allow you to easily mock HTTP responses in your tests

Installation

With pip:

$ pip install responses_proxy

Using docker:

$ docker run --rm -v tests/responses:/tests/responses bearstech/responses_proxy -h

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/

NB: With docker you’ll have to mount the volume:

$ docker run --rm -v tests/responses:/tests/responses bearstech/responses_proxy

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')

Metadata

Release files for responses_proxy 0.1.4

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

Source distribution (sdist)

Source distribution for responses_proxy 0.1.4
File Size Uploaded Provenance Actions
responses_proxy-0.1.4.tar.gz 12.1 kB Without provenance Details for responses_proxy-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for responses_proxy 0.1.4
File Interpreter ABI Platform Actions
responses_proxy-0.1.4-py2.py3-none-any.whl Python 3, Python 2 none any Details for responses_proxy-0.1.4-py2.py3-none-any.whl

Total release size: 18.4 kB

Release files / responses_proxy-0.1.4.tar.gz

Download URL responses_proxy-0.1.4.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ff3cd8224cc1b07e8e54df0a041e6b5b35a98f7ccb82c5644b04011db24a301f
BLAKE2b-256 checksum
How to use checksums
7c43223ed7b43fd6ead892e1c7abe33a2fd106ef5a74c387cbe11fa585579ff5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / responses_proxy-0.1.4-py2.py3-none-any.whl

Download URL responses_proxy-0.1.4-py2.py3-none-any.whl
Size 6.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6db4dd549b394b05175c8f79686478c04779a645c18676270b29b43320ea5b73
BLAKE2b-256 checksum
How to use checksums
46ed5b5471626ab648bc9b27696772c2faea8b0fc64ff01208b7f50b105653ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for responses_proxy 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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