Skip to main content

A simple request-mocker that will download

Project description

A simple request mocker that caches requests responses to files.

Installation

Install it with pip:

pip install rmoq

Usage

The example below will put the content of fixtures/example.com.txt into the body of the request and if it does not exist the content will be downloaded and stored in fixtures/example.com.txt.

@rmoq.activate()
def test_remote_call():
    response = requests.get('http://example.com')
    assert response.body == 'Example'

More advanced usage can be found in the documentation.


MIT © Rolf Erik Lekang

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rmoq-0.4.2.tar.gz (4.3 kB view hashes)

Uploaded source

Built Distribution

rmoq-0.4.2-py2.py3-none-any.whl (6.2 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page