hamcrest matchers for mock assertions
Project description
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 | 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
mock_matchers-0.0.1.tar.gz
(9.3 kB
view hashes)
Built Distribution
mock_matchers-0.0.1-py2.7.egg
(9.5 kB
view hashes)