Allows
Easier mock configuration and assertions in Python using R-spec-like grammar!
allow(my_mock).to(return_value('hi').on_method('wave'))
allow(my_mock).to(return_value('bye').on_method('wave').when_called_with('see ya'))
assert my_mock.wave() == 'hi'
assert my_mock.wave('see ya') == 'bye'
This library is built to wrap and configure Mock, MagicMock and other objects from the built in unittest.mock available in Python 3.3+.
Free software: MIT license
Documentation: https://allows.readthedocs.io.
Features
R-spec-like grammar for specifing Mock behavior
Compatible with all Python standard library unittest.mock Mock (MagicMock, Patch, etc.)
Stand alone SideEffect builder to model and combine complex side effects
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2019-05-11)
First release on PyPI.
Release files for allows 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| allows-0.1.0.tar.gz | 11.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| allows-0.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 19.0 kB
Release files / allows-0.1.0.tar.gz
| Download URL | allows-0.1.0.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fda563ebb4fd9a4c8e9b5e3343ff4261665dc489a1558f995859c7b1c4452dd
|
|
BLAKE2b-256 checksum How to use checksums |
d47537ecf93443dd9c00c6f3f6fa621eb9d6db7c3d6a8955a2d97e3016f919ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
|
Release files / allows-0.1.0-py2.py3-none-any.whl
| Download URL | allows-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7be292796170c837bc3bd0945bdc3d2caf8db30898781b28808592efbcd4bff5
|
|
BLAKE2b-256 checksum How to use checksums |
b218d5900a1330be599d4a95e450e62f7841691f72350395dd6fa275e1f96ad7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
|