skip to navigation
skip to content

Mocki 1.7.7

An easy-to-use but full featured mocking library for Python.

Mocki aims to be an easy-to-use but full featured mocking library for Python.


Here is how to install Mocki using pip :

pip install Mocki

Starting with Mocki

Here is how to instantiate a new mock with Mocki :

>>> import mocki.core
>>> mock = mocki.core.Mock('myMock')

There are basically two things we can do with this mock :

  • stub it to do a particular action on a particular call :
>>> mock.on_call('myCall').do_return('myValue')
>>> mock('myCall')
  • verify whether or not a particular call was invoked on it :
>>> mock.verify_call('myCall').invoked_once()
>>> mock.verify_call('myCall').invoked_exactly(2)
Traceback (most recent call last):
AssertionError: Found one matching call invoked from myMock :
> myMock('myCall')


See the online documentation for more information on how to use Mocki.

File Type Py Version Uploaded on Size
Mocki-1.7.7.tar.gz (md5) Source 2015-09-04 23KB
  • Downloads (All Versions):
  • 44 downloads in the last day
  • 285 downloads in the last week
  • 1423 downloads in the last month