{ "info": { "author": "Martin Aspeli", "author_email": "optilude@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Introduction\n============\n\nLEGACY: Do not use this any longer, better use the Python mock module!\n\nThis package contains a unittest test class based on the one from the\n``Mocker`` mock library (http://labix.org/mocker).\n\nThis class provides support for registering Zope 3 components (utilities,\nadapters, subscription adapters and event handlers) from mocks and tearing\ndown the global component registry during test tear-down.\n\nThere are also a few convenience methods and parameter checkers that are\nuseful to Zope and Plone testing.\n\nPlease see the Mocker documentation for more detail:\n\n http://labix.org/mocker\n\nA test case that mocks a utility may look like this::\n\n from plone.mocktestcase import MockTestCase\n\n from my.package.interfaces import IMyInterface\n from my.package.foo import testable_method\n\n class MyTestCase(MockTestCase):\n\n def test_something(self):\n\n utility_mock = self.mocker.mock()\n self.expect(utility_mock.do_something()).result(\"foo\")\n self.mock_utility(utility_mock, IMyInterface)\n\n # Put mocker into replay mode\n self.replay()\n\n # Verify that testable_method() looks up a utility for\n # IMyInterface and calls do_something() on it, which returns\n # \"foo\".\n\n testable_method()\n\nThe following helper methods are available:\n\n self.replay()\n Puts the mock into replay mode.\n\n self.create_dummy(**kw)\n Return a dummy object that is *not* a mock object, just a dumb object\n with whatever attributes or methods you pass as keyword arguments.\n To make a dummy method, pass a function object or a lambda, e.g.\n self.create_dummy(id=\"foo\", absolute_url=lambda:'http://example.org/foo')\n\n self.mock_utility(mock, provides, name=u\"\")\n Register the given mock object as a global utility providing the given\n interface, with the given name (defaults to the unnamed default utility).\n\n self.mock_adapter(mock, provides, adapts, name=u\"\")\n Register the given mock object as a global adapter providing the given\n interface and adapting the given interfaces, with the given name\n (defaults to the unnamed default adapter).\n\n self.mock_subscription_adapter(mock, provides, adapts)\n Register the given mock object as a global subscription adapter providing\n the given interface and adapting the given interfaces.\n\n self.mock_handler(mock, adapts)\n Register the given mock object as a global event subscriber for the\n given event types.\n\n self.mock_tool(mock, name)\n Create a getToolByName() mock (using 'replace' mode) and configure it so\n that code calling getToolByName(context, name) obtains the given mock\n object. Can be used multiple times: the getToolByName() mock is created\n lazily the first time this method is called in any one test fixture.\n\n self.match_provides(interface)\n A custom matcher that can be used to check whether an argument to a mock\n call provides the given interface. Uses interface.providedBy(arg).\n\n self.match_type(type)\n A custom matcher that can be used to check whether an argument to a mock\n call is if the given type. Uses isinstance(arg, type).\n\nChangelog\n=========\n\n1.0 (2017-01-13)\n----------------\n\n- Add MANIFEST.in.\n [timo]\n\n- fix to work with zope interface after https://github.com/zopefoundation/zope.interface/commit/79a266200384fa53fb3810ed316a94394166f4e3\n [jensens]\n\n- Fix relative import to fix Python 3 compatibility.\n [datakurre]\n\n\n1.0b3\n-----\n\n* Added mock_tool() helper.\n\n\n1.0b2\n-----\n\n* Minor amendments to mock Zope 3 component support\n\n\n1.0b1\n-----\n\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://plone.org", "keywords": "", "license": "LGPL", "maintainer": "", "maintainer_email": "", "name": "plone.mocktestcase", "package_url": "https://pypi.org/project/plone.mocktestcase/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/plone.mocktestcase/", "project_urls": { "Homepage": "http://plone.org" }, "release_url": "https://pypi.org/project/plone.mocktestcase/1.0/", "requires_dist": null, "requires_python": "", "summary": "Mock unit test case based on ``mocker``", "version": "1.0" }, "last_serial": 2571597, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "747f336b38c6eced9a1315150093a989", "sha256": "5bf5e814b889c992db113b0170bf2c919bdf0e07de3665c92c9da5b0b77494b9" }, "downloads": -1, "filename": "plone.mocktestcase-1.0.tar.gz", "has_sig": false, "md5_digest": "747f336b38c6eced9a1315150093a989", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10259, "upload_time": "2017-01-13T08:47:54", "url": "https://files.pythonhosted.org/packages/da/32/1b8b1c596ad8015b9793c51970e76e162ecfeb7acf943d0fbc6281dc2f7c/plone.mocktestcase-1.0.tar.gz" } ], "1.0b1": [ { "comment_text": "", "digests": { "md5": "80a334f1988e4bea69448044bb11eb53", "sha256": "6a553516d53274d4b487c6c39ca40d3ab3a309b2a786413aacb7874dd40a83df" }, "downloads": -1, "filename": "plone.mocktestcase-1.0b1.tar.gz", "has_sig": false, "md5_digest": "80a334f1988e4bea69448044bb11eb53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8702, "upload_time": "2008-06-29T12:48:08", "url": "https://files.pythonhosted.org/packages/45/37/0717ebbc099867602feaadd800831ca97f8e6c14b14c63769dac5dd5a65a/plone.mocktestcase-1.0b1.tar.gz" } ], "1.0b2": [ { "comment_text": "", "digests": { "md5": "f556d0c220fd88a7b0a52f12d5dee992", "sha256": "a8ffda986a7c3d767a3bc211c7f93c8472b87a971dbfcd52557f311abafc6dc4" }, "downloads": -1, "filename": "plone.mocktestcase-1.0b2.tar.gz", "has_sig": false, "md5_digest": "f556d0c220fd88a7b0a52f12d5dee992", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8727, "upload_time": "2009-02-24T05:31:43", "url": "https://files.pythonhosted.org/packages/eb/4f/a4cc996d4392117621636e08e4d0eaf913520d343958010d05c8cf32bf42/plone.mocktestcase-1.0b2.tar.gz" } ], "1.0b3": [ { "comment_text": "", "digests": { "md5": "6de66da6d610537d1f5c31e2ab0f36ee", "sha256": "56334479dd1d35816ce1f3f85ef09ca5d1a22bf998e058753674057365b1d35b" }, "downloads": -1, "filename": "plone.mocktestcase-1.0b3.tar.gz", "has_sig": false, "md5_digest": "6de66da6d610537d1f5c31e2ab0f36ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9466, "upload_time": "2009-07-12T12:47:39", "url": "https://files.pythonhosted.org/packages/4a/b1/08cf9730ec0466c0e20fd30ad2a204abb509af5a27c1f5c6b8feb5e399f4/plone.mocktestcase-1.0b3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "747f336b38c6eced9a1315150093a989", "sha256": "5bf5e814b889c992db113b0170bf2c919bdf0e07de3665c92c9da5b0b77494b9" }, "downloads": -1, "filename": "plone.mocktestcase-1.0.tar.gz", "has_sig": false, "md5_digest": "747f336b38c6eced9a1315150093a989", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10259, "upload_time": "2017-01-13T08:47:54", "url": "https://files.pythonhosted.org/packages/da/32/1b8b1c596ad8015b9793c51970e76e162ecfeb7acf943d0fbc6281dc2f7c/plone.mocktestcase-1.0.tar.gz" } ] }