Skip to main content

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.

This tool was inspired by:

Metadata

Release files for recorder-mock 0.0.1

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

Source distribution (sdist)

Source distribution for recorder-mock 0.0.1
File Size Uploaded Provenance Actions
recorder_mock-0.0.1.tar.gz 4.1 kB Without provenance Details for recorder_mock-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for recorder-mock 0.0.1
File Interpreter ABI Platform Actions
recorder_mock-0.0.1-py3-none-any.whl Python 3 none any Details for recorder_mock-0.0.1-py3-none-any.whl

Total release size: 6.9 kB

Release files / recorder_mock-0.0.1.tar.gz

Download URL recorder_mock-0.0.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fe2cbacdb9292e81ce3390c852261f80929ff8e9f874c29ec1fc2d61b5f8adc9
BLAKE2b-256 checksum
How to use checksums
ed07c6d4ae1533ecd27f39e33f9e4c381161b3d8e43bc3003f6866c50b3a6df8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.3

Release files / recorder_mock-0.0.1-py3-none-any.whl

Download URL recorder_mock-0.0.1-py3-none-any.whl
Size 2.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f519692cfa958a59ff6ed7eb59bb8c5fe462a23eaaf5cbaa3fc639cde77afa3
BLAKE2b-256 checksum
How to use checksums
79496f1cb994e235bb62674b33d23a4c25ae8d81aff4d5959c076c6a05316b56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.3

Security for recorder-mock 0.0.1

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.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

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