{ "info": { "author": "Antti Kaihola", "author_email": "akaihol+python@ambitone.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Testing" ], "description": "eyam is a Python module that provides isolation of objects,\nfunctions and methods by mocking most of the contents in a module with\nMock objects (from Michael Foord's Mock library). It removes the need\nto individually mock all objects which the method under test depends\non. After performing an action, you can inspect calls made by the code\nunder test in the usual way with tools provided by the mock.py\nlibrary.\n\nmock is tested on Python version 2.6.\n\n* `eyam on GitHub (repository and issue tracker) `_\n\neyam is very easy to use and is designed for use with\nMichael Foord's Mock library.\n\nYou can mock classes, instances, functions and methods. The syntax is\nstraightforward:\n\n >>> from eyam import isolate\n >>> import tests.isolationfixture as mod\n\n >>> def dump(expr):\n ... print '%s == %r' % (expr, eval('mod.%s' % expr))\n\nWhole classes can be isolated:\n\n >>> with isolate(mod, 'UnmockedClass'): #doctest:+ELLIPSIS\n ... dump('MyClass')\n ... dump('UnmockedClass')\n MyClass == \n UnmockedClass == \n\nInstances of an isolated class work as normally. Instances of mocked\nclasses are Mock objects, so their methods return Mock objects:\n\n >>> with isolate(mod, 'UnmockedClass'): #doctest:+ELLIPSIS\n ... dump('MyClass().bogus()')\n ... dump('UnmockedClass().instance_method()')\n MyClass().bogus() == \n UnmockedClass().instance_method() == 'return value of UnmockedClass.instance_method()'\n\nInstances can be isolated as well:\n\n >>> with isolate(mod, 'unmocked_instance'): #doctest:+ELLIPSIS\n ... dump('my_instance')\n ... dump('unmocked_instance')\n my_instance == \n unmocked_instance == \n\nIndividual methods of an instance can be isolated. The instance\nbecomes a Mock object, but the original method is re-bound to it:\n\n >>> with isolate(mod, 'my_instance.unmocked_method'): #doctest:+ELLIPSIS\n ... dump('my_instance')\n ... dump('my_instance.unmocked_method')\n ... dump('my_instance.unmocked_method()')\n my_instance == \n my_instance.unmocked_method == >\n my_instance.unmocked_method() == 'return value of MyClass.unmocked_method'\n\nAll other methods and attributes of the instance are mocked.\n\n >>> with isolate(mod, 'my_instance.unmocked_method'): #doctest:+ELLIPSIS\n ... dump('my_instance.instance_method')\n ... dump('my_instance.instance_method()')\n my_instance.instance_method == \n my_instance.instance_method() == \n\nNon-isolated instances become Mock objects, and their methods return\nMock objects:\n\n >>> with isolate(mod, 'my_instance.unmocked_method'): #doctest:+ELLIPSIS\n ... dump('unmocked_instance.instance_method')\n ... dump('unmocked_instance.instance_method()')\n unmocked_instance.instance_method == \n unmocked_function() == 'return value of unmocked_function'\n\nOther functions are replaced with mock objects:\n\n >>> with isolate(mod, 'unmocked_function'): #doctest:+ELLIPSIS\n ... dump('my_function')\n ... dump('my_function()')\n my_function == \n my_function() == \n\nThe distribution contains tests and documentation. The tests require\n`unittest2 `_ to run.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/akaihola/eyam/", "keywords": "testing,test,mock,mocking,unittest,patching,stubs,fakes,doubles", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "eyam", "package_url": "https://pypi.org/project/eyam/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/eyam/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/akaihola/eyam/" }, "release_url": "https://pypi.org/project/eyam/0.1/", "requires_dist": null, "requires_python": null, "summary": "A Python Mocking Isolation Library for Testing", "version": "0.1" }, "last_serial": 791828, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "36ae3cb36dfefff85173cbb18ba56708", "sha256": "c2c9d3bd21549aab89a9d4b7d1b30ff6f8691d78c1ea58d1ebbb1ca676a0102b" }, "downloads": -1, "filename": "eyam-0.1.tar.gz", "has_sig": false, "md5_digest": "36ae3cb36dfefff85173cbb18ba56708", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4377, "upload_time": "2012-02-28T14:24:26", "url": "https://files.pythonhosted.org/packages/63/c6/f2b188be47797b0f80848cef65f37d17bb439ba96ec5b8b486a8350e0fee/eyam-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "36ae3cb36dfefff85173cbb18ba56708", "sha256": "c2c9d3bd21549aab89a9d4b7d1b30ff6f8691d78c1ea58d1ebbb1ca676a0102b" }, "downloads": -1, "filename": "eyam-0.1.tar.gz", "has_sig": false, "md5_digest": "36ae3cb36dfefff85173cbb18ba56708", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4377, "upload_time": "2012-02-28T14:24:26", "url": "https://files.pythonhosted.org/packages/63/c6/f2b188be47797b0f80848cef65f37d17bb439ba96ec5b8b486a8350e0fee/eyam-0.1.tar.gz" } ] }