recorder-mock allows to record interactions on patched Python objects and repeat the interactions when the patched object is no longer available.
Project description
recorder-mock allows to record interactions on patched Python objects and repeat the interactions when the patched object is no longer available.
Installation
pip install recorder-mock
Usage
from recorder_mock import recorder_patch
@recorder_patch("httpx")
class ExampleTestCase(unittest.TestCase):
def test_get_example_com_content():
client = httpx.client()
resp = client.get("example.com")
return resp.content
First execution of the tests will hit the Internet and record the interactions. Second test run won't hit the internet, recorded interactions will be repeated instead.
Related projects
This tool was inspired by:
patchandMagicMockfrom unittest.mock standard library package- VCR.py package
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file recorder_mock-0.0.1.tar.gz.
File metadata
- Download URL: recorder_mock-0.0.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe2cbacdb9292e81ce3390c852261f80929ff8e9f874c29ec1fc2d61b5f8adc9
|
|
| MD5 |
c7b9318f0bd8b29a6612bb4847a51b6e
|
|
| BLAKE2b-256 |
ed07c6d4ae1533ecd27f39e33f9e4c381161b3d8e43bc3003f6866c50b3a6df8
|
File details
Details for the file recorder_mock-0.0.1-py3-none-any.whl.
File metadata
- Download URL: recorder_mock-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f519692cfa958a59ff6ed7eb59bb8c5fe462a23eaaf5cbaa3fc639cde77afa3
|
|
| MD5 |
52708c5e75dda9fdf16fff37f22e3850
|
|
| BLAKE2b-256 |
79496f1cb994e235bb62674b33d23a4c25ae8d81aff4d5959c076c6a05316b56
|