mocksey
Stupidly-simple python mocking utility with moxie.
Mocksey Motivation
I was teaching a class on unit testing to a group of co-workers who were familiar with Simple Test for PHP so I hacked together what is becoming Mocksey.
Mocksey the TDD’d version of that TDD utilty. It’s so meta even this acronym.
Installation
Either find mocksey on PyPI or install it with pip or easy_install
pip install mocksey #or easy_install mocksey
Basic Usage
It’s pretty simple. Create a mocked object with generate_mock, inject it (or monkey patch) and set up your assertions. After your function call(s), simply call ‘run_asserts’ and win!
The unit tests are a pretty decent working example.
Tweaksey
Tweaksey is a collection of beautification wrappers. Currently there’s only one around mock, but there may be more in the future. It’ll look best if you also have nose installed, and may only be worth it in that case, actually. Anyhow, to use it simply import tweaksey from mocksey and get your copy of the mock package from tweaksey.tweak_mock. Your mock assertions should now have a touch more friendliness. If there are more you’d like to add, go for it! Michael Foord, if you want to take the output and run, that cool too (conversely, if you don’t like that I did this, I’ll kill it square dead).
Changelog
0.3.1
Mocksey now sets nose to full diff mode.
0.3.0
Tweaksey now requires you to pass in the ‘mock’ library that you’re tweaking. This allows one to apply mocks to python3’s unittest.mock.
License
This software is hereby released under the MIT License, as seen in the LICENSE file
Metadata
Release files for mocksey 0.4.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 | Provenance | Actions |
|---|---|---|---|---|
| mocksey-0.4.0.tar.gz | 9.9 kB | Without provenance | Details for mocksey-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mocksey-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for mocksey-0.4.0-py3-none-any.whl |
Total release size: 20.8 kB
Release files / mocksey-0.4.0.tar.gz
| Download URL | mocksey-0.4.0.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0f169cb1b78c6846903c23667652e8eb207b627bd9abd5cdda9aeb2cf7d8bf1
|
|
BLAKE2b-256 checksum How to use checksums |
ffc328b1ab931be5a24f48fbb8fbfe5e8214b8a3182d8d41c619ab5351566e4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.6 CPython/2.7.16 Darwin/20.6.0
|
Release files / mocksey-0.4.0-py3-none-any.whl
| Download URL | mocksey-0.4.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c71569a1d4bf981896a1ca0b92eecd88859e41fa637a0aaf9afa5c95fc3abcd
|
|
BLAKE2b-256 checksum How to use checksums |
3e2fa576bb160553b680b12922d079b70e7c621faf39353ad87865bccf9db70f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.6 CPython/2.7.16 Darwin/20.6.0
|
Security for mocksey 0.4.0
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.