Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/msabramo/capturemock_examples

Examples of using capturemock
https://github.com/msabramo/capturemock_examples

Last synced: 28 days ago
JSON representation

Examples of using capturemock

Awesome Lists containing this project

README

        

capturemock_examples
====================

[![Build
Status](https://travis-ci.org/msabramo/capturemock_examples.svg?branch=master)](https://travis-ci.org/msabramo/capturemock_examples)

Examples of using
[CaptureMock](https://pypi.python.org/pypi/CaptureMock) to record and
replay calls in Python code.

```
(capturemock)marca@marca-mac2:~/dev/git-repos/capturemock_examples$ python test_requests.py
resp =
resp.url = u'http://www.google.com/'
resp.status_code = 999
resp.text = u'This is a fake response from CaptureMock!'
resp.headers = CaseInsensitiveDict({'X-Foo': 'Bar', 'Server': 'Fake
(capturemock)', 'Content-Type': 'text/plain; charset=UTF-8'})
resp.headers['Content-Type'] = 'text/plain; charset=UTF-8'
```