Skip to main content

hamcrest matchers for mock assertions

Project description

pypi license

mock.matchers simply makes PyHamcrest matchers usable with the mock assertion calls.

Examples:

from mock import Mock
import mock_matchers

m = Mock()
m.foo(1,2,3)
m.bar([1,2,3])

m.foo.assert_called_with(
    mock_matchers.instance_of(int),
    mock_matchers.instance_of(int),
    3
)
m.foo.assert_called_with(
    [
                    mock_matchers.instance_of(int),
                    2,
                    3
    ]
)
m.foo.assert_called_with(mock_matchers.isntance_of(list))

etc… For a full list of available matchers refer to the PyHamcrest Matchers documentation and simply replace from hamcrest import <name_of_matcher> with from mock_matchers import <name_of_matcher>

Project details


Release history Release notifications

This version
History Node

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
mock_matchers-0.0.1-py2.7.egg (9.5 kB) Copy SHA256 hash SHA256 Egg 2.7
mock_matchers-0.0.1.tar.gz (9.3 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page