# matchmock
[![PyPI Version][pypi-image]](https://pypi.python.org/pypi?name=matchmock&:action=display)
[![Build Status][travis-image]](https://travis-ci.org/keis/matchmock)
[![Coverage Status][coveralls-image]](https://coveralls.io/r/keis/matchmock?branch=master)
[Hamcrest][hamcrest] matchers for [mock][mock] objects.
Starting from version 2.0.0 **python2 is no longer supported** the 1.x series
will remain supported but no new features will be added.
## Example
```
f = Mock()
f.method('foo', 'bar')
assert_that(f.method, called_once_with(anything(), 'bar')
```
## Matchers
* `called` - match mock that was called one or more times
* `not_called` - match mock that was never called
* `called_once` - match mock that was called once regardless of arguments
* `called_with` - match mock has at least one call with the specified arguments
* `called_once_with` - match mock that was called once and with the specified arguments
* `called_n_times` - match mock that was called number of times.
[hamcrest]: http://hamcrest.org/
[mock]: https://docs.python.org/3/library/unittest.mock.html
[pypi-image]: https://img.shields.io/pypi/v/matchmock.svg?style=flat
[travis-image]: https://img.shields.io/travis/keis/matchmock.svg?style=flat
[coveralls-image]: https://img.shields.io/coveralls/keis/matchmock.svg?style=flat
Raw data
{
"_id": null,
"home_page": "https://github.com/keis/matchmock",
"name": "matchmock",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "David Keijser",
"author_email": "keijser@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e8/ef/502b2eba4e29f75c53457fc4d15211db240fd8a19bbcc0b945e7e1e09da3/matchmock-2.1.1.tar.gz",
"platform": null,
"description": "# matchmock\n\n[![PyPI Version][pypi-image]](https://pypi.python.org/pypi?name=matchmock&:action=display)\n[![Build Status][travis-image]](https://travis-ci.org/keis/matchmock)\n[![Coverage Status][coveralls-image]](https://coveralls.io/r/keis/matchmock?branch=master)\n\n[Hamcrest][hamcrest] matchers for [mock][mock] objects.\n\nStarting from version 2.0.0 **python2 is no longer supported** the 1.x series\nwill remain supported but no new features will be added.\n\n## Example\n\n```\n f = Mock()\n f.method('foo', 'bar')\n\n assert_that(f.method, called_once_with(anything(), 'bar')\n```\n\n## Matchers\n\n* `called` - match mock that was called one or more times\n* `not_called` - match mock that was never called\n* `called_once` - match mock that was called once regardless of arguments\n* `called_with` - match mock has at least one call with the specified arguments\n* `called_once_with` - match mock that was called once and with the specified arguments\n* `called_n_times` - match mock that was called number of times.\n\n[hamcrest]: http://hamcrest.org/\n[mock]: https://docs.python.org/3/library/unittest.mock.html\n[pypi-image]: https://img.shields.io/pypi/v/matchmock.svg?style=flat\n[travis-image]: https://img.shields.io/travis/keis/matchmock.svg?style=flat\n[coveralls-image]: https://img.shields.io/coveralls/keis/matchmock.svg?style=flat\n",
"bugtrack_url": null,
"license": "",
"summary": "Hamcrest matchers for mock objects.",
"version": "2.1.1",
"project_urls": {
"Homepage": "https://github.com/keis/matchmock"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a00508f68c7c53756827cd3867ae60bdd9b5ec2f8c9c28a85e12022b7b2b1986",
"md5": "5bbb8c70441b3b327a03fb1c3fb38616",
"sha256": "f063a61784a07f31d84ad5715db140c86240219509d79e3cc7500fe6190ee645"
},
"downloads": -1,
"filename": "matchmock-2.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5bbb8c70441b3b327a03fb1c3fb38616",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4577,
"upload_time": "2023-07-26T09:27:57",
"upload_time_iso_8601": "2023-07-26T09:27:57.693676Z",
"url": "https://files.pythonhosted.org/packages/a0/05/08f68c7c53756827cd3867ae60bdd9b5ec2f8c9c28a85e12022b7b2b1986/matchmock-2.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e8ef502b2eba4e29f75c53457fc4d15211db240fd8a19bbcc0b945e7e1e09da3",
"md5": "bd09c540d44c81dd32d2bb49b3f1c5a8",
"sha256": "3b65b79a9d3bcf35ffcb9f7c7f8f804e0ab8ce2d32b7308ab91e964d12470479"
},
"downloads": -1,
"filename": "matchmock-2.1.1.tar.gz",
"has_sig": false,
"md5_digest": "bd09c540d44c81dd32d2bb49b3f1c5a8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5342,
"upload_time": "2023-07-26T09:27:59",
"upload_time_iso_8601": "2023-07-26T09:27:59.054784Z",
"url": "https://files.pythonhosted.org/packages/e8/ef/502b2eba4e29f75c53457fc4d15211db240fd8a19bbcc0b945e7e1e09da3/matchmock-2.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-26 09:27:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "keis",
"github_project": "matchmock",
"travis_ci": true,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "matchmock"
}