Fluent interface facade for Michael Foord's mock.
Project description
Fluent interface facade for Michael Foord’s Mock. * Easy and readable configuration of mock side effects. * Configuration and verification using matchers.
A example test using fluentmock and hamcrest: ```python from fluentmock import UnitTests, when, verify from hamcrest import assert_that, equal_to
class SeveralAnswersTests(UnitTests): def test_should_return_configured_values_in_given_order(self):
when(targetpackage).targetfunction(2).then_return(1).then_return(2).then_return(3) assert_that(targetpackage.targetfunction(2), equal_to(1)) assert_that(targetpackage.targetfunction(2), equal_to(2)) assert_that(targetpackage.targetfunction(2), equal_to(3)) verify(targetpackage).targetfunction(2)
```
Documentation
Motivation
… was to replace mockito with something that is as powerful as Mock.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fluentmock-0.2.2.tar.gz
(9.5 kB
view hashes)
Built Distribution
Close
Hashes for fluentmock-0.2.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bacafd90b37a93735495d9e793aa28514379d022a16a26641b84f034386a4a72 |
|
MD5 | cf2b5a419754f2550d607855ba4bdbd9 |
|
BLAKE2b-256 | e9f55c5aef0f1e2a86440808cc9f8241378fbc43545352d491fa7ac3616455ab |