Mock library to replace aioredis during unit tests
mockaioredis is to aioredis what the mockredispy library is to plain redis-py. It uses the mockredispy library and wraps it in the asyncio magic required to work like aioredis.
Uses the new async keyword for Python 3.5, so no 3.4 support.
Beware: This is an early alpha that isn't even close to API-complete. In fact, so far it only supports the limited set of calls I needed for another project. Eventually, as I use more and more aioredis calls in my other projects, this mock layer will be fleshed out more.
Installation
You can install mockaioredis from PYPI by running pip install mockaioredis.
If you want to update an existing install, run pip install --update mockaioredis.
You can also clone this repository from github and run pip install . from the repository base directory.
Usage
You can use it as a fixture using pytest-mock
import mockaioredis
@pytest.fixture(autouse=True)
def redis(mocker):
"""Mock Redis."""
mocker.patch.object(aioredis, 'create_pool', new=mockaioredis.create_pool)
License
Like mockredispy, mockaioredis is licensed under the Apache License, Version 2.0.
See LICENSE for details.
Metadata
Release files for mockaioredis 0.0.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mockaioredis-0.0.16.tar.gz | 9.3 kB | Without provenance | Details for mockaioredis-0.0.16.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mockaioredis-0.0.16-py3-none-any.whl | Python 3 | none | any | Details for mockaioredis-0.0.16-py3-none-any.whl |
Total release size: 23.3 kB
Release files / mockaioredis-0.0.16.tar.gz
| Download URL | mockaioredis-0.0.16.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d30d13e4f4312a2edae985dca2a8827f8c58ca0e64240f364530d182ede804fe
|
|
BLAKE2b-256 checksum How to use checksums |
a1bb29b47ffe1765adcb2e01b6a43f0153b5bf32d13fd307d32ab71f5745b0ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Release files / mockaioredis-0.0.16-py3-none-any.whl
| Download URL | mockaioredis-0.0.16-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
46ec714d905eb62f35b12254bd8a892f5b5a11c6de77dd155d99d872e274a80b
|
|
BLAKE2b-256 checksum How to use checksums |
e50ca42084a6924795acf869e26bbd8637560b6f22b8e3f2ce93aac1a91b732f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Security for mockaioredis 0.0.16
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.