Skip to main content

Fluent interface facade for Michael Foord's mock.

Project description

Logo Build Status

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


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)

Uploaded Source

Built Distribution

fluentmock-0.2.2-py2.py3-none-any.whl (12.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page