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>
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mock_matchers-0.0.1.tar.gz.
File metadata
- Download URL: mock_matchers-0.0.1.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
622a00a0aa4e8827cec4d10fd2959dca91be18dc999a2fed2754cef91b4767f4
|
|
| MD5 |
63fe568ee92846c8a47e1e0e8be53c08
|
|
| BLAKE2b-256 |
dffd7fde47abc147274c5f01cf231ec5b0a9b42cceb1fd264ff98389a1acbd68
|
File details
Details for the file mock_matchers-0.0.1-py2.7.egg.
File metadata
- Download URL: mock_matchers-0.0.1-py2.7.egg
- Upload date:
- Size: 9.5 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c65a2703b32e77a8de12a3e50efdbbb8d367f112c9d49d813ff4b03e37e2eb9
|
|
| MD5 |
2946d58be5631091830b5fe0b2f21129
|
|
| BLAKE2b-256 |
25bbfb1a9de94be706abc623e2aa38c92db416ee87301468ed56f935b28229a3
|