mocking in python
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
pock
tests
.gitignore
.gitlab-ci.yml
.travis.yml
CHANGES.rst
LICENSE.txt
MANIFEST.in
README.rst
build-requirements.txt
planks.py
setup.py

README.rst

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