{ "info": { "author": "Affinitic", "author_email": "jfroche@affinitic.be", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Introduction\n============\n\nWhat's the use to declare an interface if your class doesn't implement correctly the interface ?\n\nOf course you should verify that in a test but if you don't want to write a test to check that all your code really implements the promised interfaces use this package.\n\nIt's a simple patch that calls ``zope.interface.verify.verifyClass`` once you declare implementing an\ninterface and print the BrokenImplementation or BrokenMethodImplementation as a warning (if any).\n\nSimple example in testrunner:\n-----------------------------\n\nBy default the egg enable interface contract verification for ``zope.interface.implements`` and\n``zope.interface.classImplements`` that are present in all your packages::\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts =\n ... test\n ...\n ... [test]\n ... recipe = zc.recipe.testrunner\n ... eggs = affinitic.verifyinterface\n ... zope.exceptions\n ... defaults = ['-m', 'module']\n ... \"\"\")\n\n >>> print system(buildout)\n Installing test.\n ...\n\n >>> from os.path import join\n >>> print system(join('bin', 'test')),\n failed implementing : An object has failed to implement interface \n \n The bla attribute was not provided.\n \n failed implementing : An object has failed to implement interface \n \n The bla attribute was not provided.\n \n Running zope.testing.testrunner.layer.UnitTests tests:\n Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds.\n Ran 2 tests with 0 failures and 0 errors in 0.000 seconds.\n Tearing down left over layers:\n Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds.\n\n\nLimit verifications\n-------------------\n\nBut you can limit the package where this verification needs to be done (sometimes you don't care that\na package you depend on didn't implement correctly an interface).\n\nThis is done by adding an environment variable ``verifyinterface`` where you specify what packages/modules (separated by \\n as usual) you accept to verify interfaces.\n\nHere is a simple example where I only want to have warning for bad implementation of interfaces used by module1::\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts =\n ... test\n ...\n ... [test]\n ... recipe = zc.recipe.testrunner\n ... eggs = affinitic.verifyinterface\n ... zope.exceptions\n ... defaults = ['-m', 'module']\n ... environment = testenv\n ...\n ... [testenv]\n ... verifyinterface = affinitic.verifyinterface.tests.test_module1\n ... \"\"\")\n\n >>> print system(buildout)\n Uninstalling test.\n Installing test.\n ...\n\n >>> from os.path import join\n >>> print system(join('bin', 'test'))\n failed implementing : An object has failed to implement interface \n \n The bla attribute was not provided.\n \n Running zope.testing.testrunner.layer.UnitTests tests:\n Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds.\n Ran 2 tests with 0 failures and 0 errors in 0.000 seconds.\n Tearing down left over layers:\n Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds.\n\nChangelog\n=========\n\n0.1 (2009-12-18)\n----------------\n\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://hg.affinitic.be/affinitic.verifyinterface", "keywords": "interface zope.interface", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "affinitic.verifyinterface", "package_url": "https://pypi.org/project/affinitic.verifyinterface/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/affinitic.verifyinterface/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://hg.affinitic.be/affinitic.verifyinterface" }, "release_url": "https://pypi.org/project/affinitic.verifyinterface/0.1/", "requires_dist": null, "requires_python": null, "summary": "Verify interface contract for all implements/classImplements declaration", "version": "0.1" }, "last_serial": 786158, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "484e82a7e2774ad0cbdf146845311d08", "sha256": "314df53c28fe2b7f4d2610508b0154239021956d580b69466ca1769b578b6e02" }, "downloads": -1, "filename": "affinitic.verifyinterface-0.1.tar.gz", "has_sig": false, "md5_digest": "484e82a7e2774ad0cbdf146845311d08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4577, "upload_time": "2009-12-18T16:09:37", "url": "https://files.pythonhosted.org/packages/96/39/f7ca7bd412e7430f634c2f44d6c836fc8ad7cd07251d95f12e3715008bd4/affinitic.verifyinterface-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "484e82a7e2774ad0cbdf146845311d08", "sha256": "314df53c28fe2b7f4d2610508b0154239021956d580b69466ca1769b578b6e02" }, "downloads": -1, "filename": "affinitic.verifyinterface-0.1.tar.gz", "has_sig": false, "md5_digest": "484e82a7e2774ad0cbdf146845311d08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4577, "upload_time": "2009-12-18T16:09:37", "url": "https://files.pythonhosted.org/packages/96/39/f7ca7bd412e7430f634c2f44d6c836fc8ad7cd07251d95f12e3715008bd4/affinitic.verifyinterface-0.1.tar.gz" } ] }