{ "info": { "author": "Jaime Gil de Sagredo Luna", "author_email": "jaimegildesagredo@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "===============\nDoublex Expects\n===============\n\n.. image:: https://img.shields.io/pypi/v/doublex-expects.svg\n :target: https://pypi.python.org/pypi/doublex-expects\n :alt: Latest version\n\n.. image:: https://img.shields.io/badge/Licence-Apache2-brightgreen.svg\n :target: https://www.tldrlegal.com/l/apache2\n :alt: License\n\n.. image:: https://img.shields.io/pypi/dm/doublex-expects.svg\n :target: https://pypi.python.org/pypi/doublex-expects\n :alt: Number of PyPI downloads\n\n.. image:: https://secure.travis-ci.org/jaimegildesagredo/doublex-expects.svg?branch=master\n :target: http://travis-ci.org/jaimegildesagredo/doublex-expects\n\nDoublex-Expects is a matchers library for the `Expects `_ assertion library. It provides matchers for the `Doublex `_ test double library.\n\nUsage\n=====\n\nJust import the ``expect`` callable and the Doublex-Expects matchers and start writing assertions for test doubles.\n\nSpies\n-----\n\n.. code-block:: python\n\n from expects import expect\n from doublex_expects import *\n from doublex import Spy\n\n my_spy = Spy()\n\n my_spy.method()\n\n expect(my_spy.method).to(have_been_called)\n\nMocks\n-----\n\n.. code-block:: python\n\n from expects import expect\n from doublex_expects import *\n from doublex import Mock\n\n with Mock() as my_mock:\n my_mock.reset()\n my_mock.add(1)\n\n my_mock.reset()\n my_mock.add(1)\n\n expect(my_mock).to(have_been_satisfied)\n\nMatchers\n========\n\nhave_been_called\n----------------\n\nAsserts that a spy has been called.\n\n.. code-block:: python\n\n expect(my_spy.method).to(have_been_called)\n expect(my_spy.method).not_to(have_been_called)\n\nhave_been_called_with\n---------------------\n\nAsserts that a spy has been called with given arguments.\n\n.. code-block:: python\n\n expect(my_spy.method).to(have_been_called_with('foo', key='bar'))\n expect(my_spy.method).to(have_been_called_with(a(str), key=match('\\w+')))\n expect(my_spy.method).to(have_been_called_with(anything, key='bar'))\n expect(my_spy.method).to(have_been_called_with('foo', any_arg))\n expect(my_spy.method).not_to(have_been_called_with('bar', key='foo'))\n\nTimes called modifiers\n----------------------\n\nonce\n^^^^\n\nAsserts that a spy has been called exactly *once*.\n\n.. code-block:: python\n\n expect(my_spy.method).to(have_been_called.once)\n expect(my_spy.method).to(have_been_called_with('foo').once)\n expect(my_spy.method).not_to(have_been_called.once)\n\ntwice\n^^^^^\n\nAsserts that a spy has been called exactly *twice*.\n\n.. code-block:: python\n\n expect(my_spy.method).to(have_been_called.twice)\n expect(my_spy.method).to(have_been_called_with('foo').twice)\n expect(my_spy.method).not_to(have_been_called.twice)\n\nexactly\n^^^^^^^\n\nAsserts that a spy has been called exactly *n* times.\n\n.. code-block:: python\n\n expect(my_spy.method).to(have_been_called.exactly(3))\n expect(my_spy.method).to(have_been_called_with('foo').exactly(3))\n expect(my_spy.method).not_to(have_been_called.exactly(3))\n\nmax\n^^^\n\nAsserts that a spy has been called maximum of *n* times.\n\n.. code-block:: python\n\n expect(my_spy.method).to(have_been_called.max(2))\n expect(my_spy.method).to(have_been_called_with('foo').max(2))\n expect(my_spy.method).not_to(have_been_called.max(2))\n\nmin\n^^^\n\nAsserts that a spy has been called minimum of *n* times.\n\n.. code-block:: python\n\n expect(my_spy.method).to(have_been_called.min(2))\n expect(my_spy.method).to(have_been_called_with('foo').min(2))\n expect(my_spy.method).not_to(have_been_called.min(2))\n\nhave_been_satisfied\n-------------------\n\nVerifies that a mock calls have been satisfied.\n\n.. code-block:: python\n\n expect(my_mock).to(have_been_satisfied)\n expect(my_mock).not_to(have_been_satisfied)\n\nhave_been_satisfied_in_any_order\n--------------------------------\n\nVerifies that a mock calls have been satisfied regardless of the execution order.\n\n.. code-block:: python\n\n expect(my_mock).to(have_been_satisfied_in_any_order)\n expect(my_mock).not_to(have_been_satisfied_in_any_order)\n\nInstallation\n============\n\nYou can install the last stable release from PyPI using *pip* or *easy_install*.\n\n.. code-block:: bash\n\n $ pip install doublex-expects\n\nAlso you can install the latest sources from *Github*.\n\n.. code-block:: bash\n\n $ pip install -e git+git://github.com/jaimegildesagredo/doublex-expects.git#egg=doublex-expects\n\nSpecs\n=====\n\nTo run the specs you should install the testing requirements and then run ``mamba``.\n\n.. code-block:: bash\n\n $ python setup.py develop\n $ pip install -r test-requirements.txt\n $ mamba", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jaimegildesagredo/doublex-expects", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "doublex-expects", "package_url": "https://pypi.org/project/doublex-expects/", "platform": "", "project_url": "https://pypi.org/project/doublex-expects/", "project_urls": { "Homepage": "https://github.com/jaimegildesagredo/doublex-expects" }, "release_url": "https://pypi.org/project/doublex-expects/0.7.1/", "requires_dist": null, "requires_python": "", "summary": "Expects matchers for Doublex test doubles assertions", "version": "0.7.1" }, "last_serial": 5699971, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5f6288ff32ee298d7d3f7e638acb9433", "sha256": "a041a973bc9440a5be2da57c1e584245051d068ad1415d2454609fcd44be064e" }, "downloads": -1, "filename": "doublex-expects-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5f6288ff32ee298d7d3f7e638acb9433", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2848, "upload_time": "2014-06-05T20:44:43", "url": "https://files.pythonhosted.org/packages/18/8a/e52933dd5454ca1a3948c8fa4405f3e7be0e36f704d2b69e7fc19899a4f7/doublex-expects-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "5ebf74b55d4a1fdc823334520de8a822", "sha256": "3ce016c76f71edbd206fc4e199a41b30791ae5406f0f8662bed7cb3dc0a734ab" }, "downloads": -1, "filename": "doublex-expects-0.2.0.tar.gz", "has_sig": false, "md5_digest": "5ebf74b55d4a1fdc823334520de8a822", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3098, "upload_time": "2014-06-10T21:29:32", "url": "https://files.pythonhosted.org/packages/aa/4a/6940ac03a50e1adb4a55f5d5bfe7a5d769201acb64e1583aeb0836c18f0e/doublex-expects-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "6636203ceb105d4ecda670baf908dc91", "sha256": "83d4f4ad44bd79f6296109411b5a919db5b21adfb787d6fcbef167d93e85ffdc" }, "downloads": -1, "filename": "doublex-expects-0.3.0.tar.gz", "has_sig": false, "md5_digest": "6636203ceb105d4ecda670baf908dc91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3850, "upload_time": "2014-07-10T23:23:10", "url": "https://files.pythonhosted.org/packages/34/d7/6ff949f7f6b9c86cec0cabb0be2ad076a2876f1d83b58450229f3bef063a/doublex-expects-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "5dfbca0143bd3913d2d1910ee7b83456", "sha256": "4843c73c9c7f8551a9cdbb7b7cb3a085a2259cf3ce3b157f105eb17270f6e09a" }, "downloads": -1, "filename": "doublex-expects-0.4.0.tar.gz", "has_sig": false, "md5_digest": "5dfbca0143bd3913d2d1910ee7b83456", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4220, "upload_time": "2014-08-16T15:23:31", "url": "https://files.pythonhosted.org/packages/1d/9f/f7efde657928e65a5ab703afa1ca168ee3796cc093127737c70d93e23c3d/doublex-expects-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "a069ae7977ca084f17ee035b3f9f0895", "sha256": "e44966eed5a16e374f893d1fad89d47e2f8e991dae64b1ca8a6e9149590548ed" }, "downloads": -1, "filename": "doublex-expects-0.5.0.tar.gz", "has_sig": false, "md5_digest": "a069ae7977ca084f17ee035b3f9f0895", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5799, "upload_time": "2015-01-13T21:13:29", "url": "https://files.pythonhosted.org/packages/65/67/252564d82a37d5683010484ec44eff758a45c08158a00284e93006859e10/doublex-expects-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "8b480d0db552ddc66632ec1f2080e7eb", "sha256": "6a49a051cdc989aa4005de0e60eeb4ed9d42d8bae31fa63c3928aa519016bc58" }, "downloads": -1, "filename": "doublex-expects-0.6.0.tar.gz", "has_sig": false, "md5_digest": "8b480d0db552ddc66632ec1f2080e7eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6462, "upload_time": "2015-06-25T21:53:48", "url": "https://files.pythonhosted.org/packages/6d/69/0a15e5b6535346b83ab90313c8694dd7b921aabfcfe796d621da0dd3a2df/doublex-expects-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "08b22053568cf207f608955f247b7cad", "sha256": "69bafcac049dc4f0a4d91b97e58344613f2671ea574494dbf75623fc73bdd7cd" }, "downloads": -1, "filename": "doublex-expects-0.7.0.tar.gz", "has_sig": false, "md5_digest": "08b22053568cf207f608955f247b7cad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7548, "upload_time": "2018-09-26T11:22:28", "url": "https://files.pythonhosted.org/packages/4a/ab/c11210c5516d21d8796f5f16fb4a3597477733351ba90647cd1a3b3acce6/doublex-expects-0.7.0.tar.gz" } ], "0.7.0rc1": [ { "comment_text": "", "digests": { "md5": "9bb32241a3d57b03a133451489814105", "sha256": "f8502dee1cb71fa06cf6e07d904dff863ea7859dbf779049f04d77747c1dfb7c" }, "downloads": -1, "filename": "doublex-expects-0.7.0rc1.tar.gz", "has_sig": false, "md5_digest": "9bb32241a3d57b03a133451489814105", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7336, "upload_time": "2015-07-17T07:59:36", "url": "https://files.pythonhosted.org/packages/e1/b3/82c4eaa5bc7d6f3852917f18bcdc14d9d0a464e5459c4276e8edc52683f1/doublex-expects-0.7.0rc1.tar.gz" } ], "0.7.0rc2": [ { "comment_text": "", "digests": { "md5": "4c6949c25ba2546f36c0c2896f4ce236", "sha256": "5421bd92319c77ccc5a81d595d06e9c9f7f670de342b33e8007a81e70f9fade8" }, "downloads": -1, "filename": "doublex-expects-0.7.0rc2.tar.gz", "has_sig": false, "md5_digest": "4c6949c25ba2546f36c0c2896f4ce236", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7420, "upload_time": "2015-10-26T17:29:42", "url": "https://files.pythonhosted.org/packages/94/9b/72b32242c6f6b303cb2d20b5ff8c563ea1ec4372d99f30c1ba1efc0cd89f/doublex-expects-0.7.0rc2.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "59f71a367758e1a9a97bf2af888b1264", "sha256": "8040682d97f0a66f632c5df982f78d09aee36b2c4a1eb275b0c596d115f200aa" }, "downloads": -1, "filename": "doublex-expects-0.7.1.tar.gz", "has_sig": false, "md5_digest": "59f71a367758e1a9a97bf2af888b1264", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6636, "upload_time": "2019-08-19T19:20:59", "url": "https://files.pythonhosted.org/packages/ce/e8/677f10ca523396283343a478265fbeb84e12a84406f5e6ec8b3b7d448982/doublex-expects-0.7.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "59f71a367758e1a9a97bf2af888b1264", "sha256": "8040682d97f0a66f632c5df982f78d09aee36b2c4a1eb275b0c596d115f200aa" }, "downloads": -1, "filename": "doublex-expects-0.7.1.tar.gz", "has_sig": false, "md5_digest": "59f71a367758e1a9a97bf2af888b1264", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6636, "upload_time": "2019-08-19T19:20:59", "url": "https://files.pythonhosted.org/packages/ce/e8/677f10ca523396283343a478265fbeb84e12a84406f5e6ec8b3b7d448982/doublex-expects-0.7.1.tar.gz" } ] }