A python mocking framework.


Keywords
mocking, python, testing
License
MIT
Install
pip install pock==0.0.6

Documentation

Pock

https://travis-ci.org/atbentley/pock.svg?branch=master https://coveralls.io/repos/github/atbentley/pock/badge.svg?branch=master

Pock is a mocking framework for Python that makes creating complex test behaviour a breeze. See the documentation for more information.

Installation

pip install pock

Usage

Create a mock and add some basic behaviour:

from pock import mock, when, verify

my_mock = mock()

when(my_mock).greet('Andrew').then_return('Hi, Andrew')
my_mock.greet('Andrew')  # 'Hi, Andrew'
verify(my_mock).greet('Andrew')

Testing

pip install plank
plank install_requirements
plank tests

License

MIT