Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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

Project Description

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

Installation

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')
'myValue'
  • 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')

Documentation

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

Release History

Release History

This version
History Node

1.7.7

History Node

1.7.6

History Node

1.7.5

History Node

1.7.4

History Node

1.7.3

History Node

1.7.2

History Node

1.7.1

History Node

1.7

History Node

1.6

History Node

1.5

History Node

1.4

History Node

1.3

History Node

1.2

History Node

1.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Mocki-1.7.7.tar.gz (23.8 kB) Copy SHA256 Checksum SHA256 Source Sep 4, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting