Expects plugin for Doublex test doubles assertions
First you need to have Expects installed.
$ pip install expects>=0.3
You can install the last stable release of Doublex-Expects from PyPI using pip or easy_install.
$ pip install doublex-expects
Also you can install the latest sources from Github.
$ pip install -e git+git://github.com/jaimegildesagredo/doublex-expects.git#egg=doublex-expects
There is nothing special you need to do. Just import the expect callable and start writing assertions for test doubles.
from expects import expect from doublex import Spy my_spy = Spy() expect(my_spy.method).to.have.been.called()
Assert that a spy has been called. Negation passes through.
Note that called can be used as a chainable property.
Assert that a spy has been called exactly once.
Assert that a spy has been called exactly twice.
Assert that a spy has been called exactly n times.
Assert that a spy has been called minimum of n times.
Assert that a spy has been called maximum of n times.
Assert that a spy has been called with given arguments.
expect(my_spy.method).to.have.been.called.with_args('foo', key='bar') expect(my_spy.method).not_to.have.been.called.with_args('bar', key='foo')
To run the specs you should install the testing requirements and then run mamba.
$ python setup.py develop $ pip install -r test-requirements.txt $ mamba
The Doublex-Expects is released under the Apache2 license.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size doublex-expects-0.3.0.tar.gz (3.9 kB)||File type Source||Python version None||Upload date||Hashes View hashes|