{ "info": { "author": "Andrew McFague", "author_email": "redmumba@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "Programming Language :: Python", "Topic :: Software Development :: Testing" ], "description": "``webunit2`` is a spiritual successor to `Richard Jones' webunit\n`_, but is by no means a fork. This\nlibrary has been built from the ground up, complete with documentation and\ntesting. It's also `hosted on GitHub `_,\nmaking it a cinch to fork.\n\nDocumentation\n-------------\n\n`Documentation is available on PyPi. `_.\n\nYou can also build the documentation yourself. Make sure Sphinx is installed\nby running::\n\n $ easy_install -U sphinx\n\nThen, clone the repository, `cd` into it, and run::\n\n $ python setup.py build_sphinx\n\nDocumentation is available in ``build/sphinx/html``.\n\nGetting Started\n---------------\n\nGetting started is really, really easy. All you need to do is implement\n``webunit2.testcase.Testcase`` and start writing unit tests. ::\n\n import webunit2\n\n class TestMyApp(webunit2.TestCase):\n\n def __init__(self):\n # You aren't required to initialize the base class here, but it\n # makes dealing with subsequent requests easier--because they can\n # be relative paths!\n webunit2.TestCase.__init__(self, \"http://myapp.com\")\n\n def test_some_url(self):\n # Just do a normal get\n self.get('/somepath')\n\n # Lets post some data\n self.post('/somepath', post_params={\"key\": \"value\"})\n\n # No helper function for your HTTP method? No problem!\n self.make_request(\"HEAD\", \"/somepath\")\n\nOf course, because this is a unit testing framework, you'll probably be making\na lot of assertions--especially in content. That's easy too! ::\n\n def test_for_content(self):\n # Assert the word `hippo` appears in the content.\n self.get_assertContent('/something', content=\"hippo\")\n # Assert that the `X-Customheader` header was set.\n self.get_assertHeader('/something', 'X-Customheader')\n\nIf either of these fail (i.e., the return code is not 200 or the content does\nnot contain `hippo`), an ``AssertionError`` is raised as normal. And of\ncourse, if you need to check for multiple values on the response, the same\n``assert*`` functions are available directly on the response. For example, the\nabove could be rewritten as::\n\n def test_for_content_resp(self):\n resp = self.get('/something')\n # Assert the word `hippo` appears in the content.\n resp.assertContent(\"hippo\")\n # Assert that the `X-Customheader` header was set.\n resp.assertHeader('X-Customheader')\n\nThis also allows you to chain many more assertions together--i.e., checking for\nheaders, cookies, etc.. These were *all* designed to make testing easier, so\nif you have suggestions or complaints...\n\nContributing\n------------\n\nThe source code is `hosted on Github `_,\nwhich makes it a cinch to fork and contribute. `Please submit issues using the\nGitHub tracker `_! I love getting\nfeedback, and I urge you to file tickets for features and/or bugs.", "description_content_type": null, "docs_url": "https://pythonhosted.org/webunit2/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/amcfague/webunit2", "keywords": null, "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "webunit2", "package_url": "https://pypi.org/project/webunit2/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/webunit2/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/amcfague/webunit2" }, "release_url": "https://pypi.org/project/webunit2/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Eases the testing of web services.", "version": "0.2.2" }, "last_serial": 801608, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "40759b3853573e6815e15e3809b73828", "sha256": "794b5af8c300147e00ae4269306245eecf438b1f05a816e732498d375c8b9b10" }, "downloads": -1, "filename": "webunit2-0.1.tar.gz", "has_sig": false, "md5_digest": "40759b3853573e6815e15e3809b73828", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6551, "upload_time": "2011-04-21T17:32:49", "url": "https://files.pythonhosted.org/packages/53/22/c162b979e3a1c53df8b7f46c23934e64d5e8a286e274b51f13ec9e35660b/webunit2-0.1.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "517240aec6d73323f72d59b680934e8c", "sha256": "2c0e6ecb62efa4960ab1dcc94832c862b3c6d2ea9fd649d87250cec92ce21e86" }, "downloads": -1, "filename": "webunit2-0.2.1.tar.gz", "has_sig": false, "md5_digest": "517240aec6d73323f72d59b680934e8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7053, "upload_time": "2011-09-15T22:21:47", "url": "https://files.pythonhosted.org/packages/c9/9e/9269e2eb340111b13cfba44abb1e5b10dd126c565f61d926a8321162adac/webunit2-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "fe4ba28cf7b5a5e548add1006201aa57", "sha256": "2a4fce0b6832c85325147059169e2328ca58d8c4af9244e0ef1a04a58d00b9ef" }, "downloads": -1, "filename": "webunit2-0.2.2.tar.gz", "has_sig": false, "md5_digest": "fe4ba28cf7b5a5e548add1006201aa57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7125, "upload_time": "2012-04-04T05:50:20", "url": "https://files.pythonhosted.org/packages/c1/09/6e918d6e3434ffd56bf7114a196a8b050f50a85e69f1d03bc200a3401027/webunit2-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fe4ba28cf7b5a5e548add1006201aa57", "sha256": "2a4fce0b6832c85325147059169e2328ca58d8c4af9244e0ef1a04a58d00b9ef" }, "downloads": -1, "filename": "webunit2-0.2.2.tar.gz", "has_sig": false, "md5_digest": "fe4ba28cf7b5a5e548add1006201aa57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7125, "upload_time": "2012-04-04T05:50:20", "url": "https://files.pythonhosted.org/packages/c1/09/6e918d6e3434ffd56bf7114a196a8b050f50a85e69f1d03bc200a3401027/webunit2-0.2.2.tar.gz" } ] }