{ "info": { "author": "Sumeet Agarwal", "author_email": "sumeet.a@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Testing" ], "description": "# expect\n\nInspired by [RSpec's test doubles][2] and [Expecter Gadget][3].\n\nUses [Mock][1] but provides a terser syntax for expectations.\n\nExample:\n\n```python\n>>> def assert_equal(lhs, rhs):\n... assert lhs == rhs\n>>> from expect import new_expect\n>>> expect = new_expect(__eq__=assert_equal)\n>>> expect(2) == 2\n>>> expect(2) == 3\nTraceback (most recent call last):\n ...\nAssertionError\n\n>>> class MyClass(object):\n... @classmethod\n... def my_method(cls, arg):\n... pass\n\n>>> # Stubs don't have to be called.\n>>> expect(MyClass).stub('my_method').with_(1).and_return(2)\n>>> MyClass.my_method(1)\n2\n>>> expect.reset()\n\n>>> # Mocks\n>>> expect(MyClass).should_receive('my_method').with_(1).and_return(2)\n>>> expect.verify()\nTraceback (most recent call last):\n ...\nAssertionError: Expected to be called once. Called 0 times.\n\n```\n\n[1]: http://www.voidspace.org.uk/python/mock/\n[2]: https://github.com/rspec/rspec-mocks\n[3]: https://github.com/garybernhardt/expecter", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sumeet/expect", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "expect", "package_url": "https://pypi.org/project/expect/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/expect/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/sumeet/expect" }, "release_url": "https://pypi.org/project/expect/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "Terse mock expectations for Python and Mock", "version": "0.0.1" }, "last_serial": 456767, "releases": { "0.0.1": [] }, "urls": [] }