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.3.tar.gz
(9.5 kB
view hashes)
Built Distribution
Close
Hashes for fluentmock-0.2.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad8b24fb762d7b172f4fcef0a73c96a73a3ee4a0cc703eafb8060cf955a65a29 |
|
MD5 | fd277a20ea150d75861ea17d31ec242b |
|
BLAKE2b-256 | 3b7174276feca049fed2f5dc6ded32137d7cd5be59daeae0546a824e63f969cf |