Skip to main content

Stupidly-simple python mocking utility with moxie.

Project description

mocksey

Stupidly-simple python mocking utility with moxie.

BuildImage

Latest PyPI version Number of PyPI downloads

Coverage Status

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mocksey-0.4.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mocksey-0.4.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file mocksey-0.4.0.tar.gz.

File metadata

  • Download URL: mocksey-0.4.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/2.7.16 Darwin/20.6.0

File hashes

Hashes for mocksey-0.4.0.tar.gz
Algorithm Hash digest
SHA256 b0f169cb1b78c6846903c23667652e8eb207b627bd9abd5cdda9aeb2cf7d8bf1
MD5 34207c5ea2b9b8067dc892475e9d8029
BLAKE2b-256 ffc328b1ab931be5a24f48fbb8fbfe5e8214b8a3182d8d41c619ab5351566e4d

See more details on using hashes here.

File details

Details for the file mocksey-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: mocksey-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/2.7.16 Darwin/20.6.0

File hashes

Hashes for mocksey-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c71569a1d4bf981896a1ca0b92eecd88859e41fa637a0aaf9afa5c95fc3abcd
MD5 46405e17252604abe975ee19abc5c76b
BLAKE2b-256 3e2fa576bb160553b680b12922d079b70e7c621faf39353ad87865bccf9db70f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page