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


Download files

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

Source Distribution

mock_matchers-0.0.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

mock_matchers-0.0.1-py2.7.egg (9.5 kB view details)

Uploaded Source

File details

Details for the file mock_matchers-0.0.1.tar.gz.

File metadata

File hashes

Hashes for mock_matchers-0.0.1.tar.gz
Algorithm Hash digest
SHA256 622a00a0aa4e8827cec4d10fd2959dca91be18dc999a2fed2754cef91b4767f4
MD5 63fe568ee92846c8a47e1e0e8be53c08
BLAKE2b-256 dffd7fde47abc147274c5f01cf231ec5b0a9b42cceb1fd264ff98389a1acbd68

See more details on using hashes here.

File details

Details for the file mock_matchers-0.0.1-py2.7.egg.

File metadata

File hashes

Hashes for mock_matchers-0.0.1-py2.7.egg
Algorithm Hash digest
SHA256 7c65a2703b32e77a8de12a3e50efdbbb8d367f112c9d49d813ff4b03e37e2eb9
MD5 2946d58be5631091830b5fe0b2f21129
BLAKE2b-256 25bbfb1a9de94be706abc623e2aa38c92db416ee87301468ed56f935b28229a3

See more details on using hashes here.

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