mock_matchers
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>
Metadata
Release files for mock_matchers 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mock_matchers-0.0.1.tar.gz | 9.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mock_matchers-0.0.1-py2.7.egg | Legacy Egg format | - | - | Details |
Total release size: 18.8 kB
Release files / mock_matchers-0.0.1.tar.gz
| Download URL | mock_matchers-0.0.1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
622a00a0aa4e8827cec4d10fd2959dca91be18dc999a2fed2754cef91b4767f4
|
|
BLAKE2b-256 checksum How to use checksums |
dffd7fde47abc147274c5f01cf231ec5b0a9b42cceb1fd264ff98389a1acbd68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / mock_matchers-0.0.1-py2.7.egg
| Download URL | mock_matchers-0.0.1-py2.7.egg |
|---|---|
| Size | 9.5 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
7c65a2703b32e77a8de12a3e50efdbbb8d367f112c9d49d813ff4b03e37e2eb9
|
|
BLAKE2b-256 checksum How to use checksums |
25bbfb1a9de94be706abc623e2aa38c92db416ee87301468ed56f935b28229a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |